change doc root on apache

Tom H tomh0665 at gmail.com
Sun Aug 2 03:23:40 UTC 2020


On Wed, Jul 29, 2020 at 3:02 AM Wade Smart <wadesmart at gmail.com> wrote:
>
> Im testing some updated sites on various phones and need to
> make my development computer available on my network.
>
> Ive edited the sites available, the default file, the apache2.conf
> file and nothing Ive tried to point 127.0.0.7 or localhost to
> my development files on home/username/www.

If you only want to serve "/home/username/www" at "127.0.0.7", change

1) "Listen 80" in "ports.conf" to "Listen 127.0.0.7:80"

2) "DocumentRoot /var/www/html" in
"/etc/apache2/sites-enabled/000-default.conf" to "DocumentRoot
/home/username/www"

If you want to serve "/home/username/www" at "127.0.0.7" in addition
to "127.0.0.1", you have to do a little more work.

You have to run "/usr/share/doc/apache2/examples/setup-instance seven"
(I've chosen "seven" because of the ip address, but you can use any
name).

You'll then have "/etc/apache2-seven" in which you can make the
changes above and then run "systemctl enable apache2 at seven.service" to
set up your "127.0.0.7" site.




More information about the ubuntu-users mailing list