last day (15 days later) » 

6:39 AM
0
A: how to change base url in drupal 8

No Sssweatsudo nano /etc/apache2/sites-enabled/000-default.conf Make sure it looks like this: <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the ...

 
SMJ
<VirtualHost *:80> ServerName mydomainname.com DocumentRoot /var/www/html/foldername/ </VirtualHost>
My current httpd conf has this
 
@SMJ do you have the <Directory .... </Directory> part? You probably don't, so add it. and restart apache after, sudo service apache2 restart
 
SMJ
I added it and restarted httpd. still some css and images are not being loaded. they show 404 in console. therir path has foldername in it
Links dont have foldername in it now. but website style is entirely broken
 
@SMJ did you flush the cache?
 
SMJ
yes i did flush the cache.. but css and js aggregation is on... should i turn it off
mydomainname.com/folder/themes/sochthemei/images/wave.png this is how images are being loaded. how to change path..?
when i removed the domain name from 'trusted host patterns' and clear cache, I get "The provided host name is not valid for this server." Error msg
 
6:39 AM
Have you changed the $settings['file_public_base_url'] in settings.php?
 
SMJ
Its commented in my settings.php Should I add my path
 
There shouldn't be any need to uncomment it. hmm, must be something else.
 
SMJ
In performance page i do have msg like "External resources can be optimized automatically, which can reduce both the size and number of requests made to your website. Set up the public files directory to make these optimizations available."
 
Clear your browser cache & cookies, or use Incognito window to check it's not browser cached.
 
SMJ
The loading css path is incorrect now. mydomainname.com/?p5gsbd
 
6:39 AM
@SMJ Does it fix if you turn off aggregation?
 
SMJ
I can't turn it off now. The checkboxes are disabled. In performance page i do have msg like "External resources can be optimized automatically, which can reduce both the size and number of requests made to your website. Set up the public files directory to make these optimizations available."
Sorry for being so stupid. I am really stuck. the thing is that I told my client that the website is finished. Now I cant host it. :(
 
Have you enabled a2enmod rewrite? you can by typing "a2enmod rewrite" in the console and then restart apache "sudo service apache2 restart"
 
SMJ
i had enabled it before
 
6:55 AM
does your /sites/default/files folder have the correct ownder/group? should be "www-data"
 
SMJ
its ec2-user/www
I work on an amazon linux ec2 instance
aggregated js is being loaded correctly mydomainname.com/sites/default/files/js/…
 
I use Ubuntu EC2 instance. Can you check if you can upload images?
 
SMJ
drwxrwxr-x 2 ec2-user www 4096 Dec 28 10:55 inline-files
this is how permission looks from terminal
The file could not be uploaded.
admin side also does not load style
Public file system path
sites/default/files
 
SMJ
php
Public file base URL
http://xx.xx.xxx.xx/sonycpa/sites/default/files
 
SMJ
Private file system path
Not set
 
SMJ
7:20 AM
======
The specified file <em class="placeholder">temporary://fileMWCFUU</em> could not be moved/copied because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log.
---Temporary directory is /tmp
should I change group of /tmp to www
 
yeah, do this, "cd /var/www/html/drupal" then "sudo chown www -R sites"
 
SMJ
I cant change owner. but i changed permission
sudo chmod -R 777 /var/www/html/sonycpa/sites/default/files/
 
you need to change the owner, otherwise, even with 777 it wont work.
 
SMJ
7:36 AM
chown: invalid user: ‘www’
i get this error
but page seems to load except for a few images
I changed this
$settings['file_public_base_url'] = ' http://www.mydomainname.com/sites/default/files';
 
try "sudo chown www-data -R sites"
 
SMJ
7:51 AM
that fixed it ... thanks alot.. you saved apoor soul today
One more doubt. If I had another domain name pointing to same website, I should add it in trusted host patterns in settings.php. Should I write another virtual host block for the 2nd domain name
 
write another virtual host block
cheers mate
 
SMJ
the admin side has problem but its ok ;-)
htt://www.mydomainname.com/folder/core/themes/stable/images/core/icons/787878/wr‌​ench.svg
admin side was fixed when i commented the file_public_base_url that i set before
 

last day (15 days later) »