You are not logged in.
Hi there everyone!
My default apache2 points to /var/www/html and I'd like to point it towards /home/schwim/www/public_html
So I backed up /etc/apache2/sites-available/000-default.conf and edited to reflect the change:
<VirtualHost *:80>
ServerAdmin email@domain.com
ServerName domain.com
ServerAlias www.domain.com
DocumentRoot /home/schwim/www/public_html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>Saved the file and restarted apache2 But now all the page requests are refused except for phpMyAdmin.
Forbidden
You don't have permission to access / on this server.
Apache/2.4.25 (Debian) Server at xxx.xxx.xxx.xxx Port 80
Here's my old .conf:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noetIf I visit my phpMyAdmin install, via domain.com/phpmyadmin, this resolves correctly. That seems to have been setup during the lamp stack install and I can't seem to figure out why that works but my root directory won't.
Can someone tell me what I need to do to get apache to point the default connection to /home/schwim/www/public_html?
Thanks for your time!
Last edited by schwim (2018-10-01 21:11:27)
Schw.im! A social site with an identity crisis.
Offline
It seems it was a permissions problem. I found some additional snippets that got it working:
<VirtualHost *:80>
ServerAdmin xxx
ServerName xxx
ServerAlias xxx
DocumentRoot /home/schwim/www/public_html
<Directory "/home/schwim/www/public_html">
Order allow,deny
Allow from all
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>Last edited by schwim (2018-10-01 21:11:06)
Schw.im! A social site with an identity crisis.
Offline
Just yesterday I was setting up a local virtual host, and hitting the changes between Apache 2.2 (Jessie) and 2.4 (Stretch). It took an hour or so...
I don't think you need the
Order allow,deny
Allow from allsection any more in fact, just the 'Require all granted'.
https://httpd.apache.org/docs/2.4/upgrading.html
If you want local access only, you can make that
Require localin fact.
I prefer to leave sites-available/000-default.conf alone, and add a new site: sites-available/newhost.conf then enable it with 'sudo a2ensite newhost'. (Make sure newhost is in /etc/hosts.)
Not that I'm an Apache expert or anything.
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), now on Bluesky, there's also some GitStuff )
Offline