Adding an IP-based site to an Apache web server
sudo vi /etc/httpd/sites.d/example
This will create a new file called example if one doesn't already exist.
(You need an include sites.d/*
in /etc/httpd/conf/httpd.conf)
i
to edit, this is the model (Agaric hasn't tested the subdomain part quite like this, but for just one directory, even if the domain isn't even pointing at your site yet, the IP will work):
<pre>
<VirtualHost 101.01.010.10:80>
ServerName www.example.coop
DocumentRoot /home/example/public_html/main
Options Indexes FollowSymLinks
</VirtualHost>
<VirtualHost 101.01.010.01:80>
ServerName test.example.coop
DocumentRoot /home/example/public_html/test
Options Indexes FollowSymLinks
</VirtualHost>
Shift-ZZ
to save and exit.
And then:
sudo /etc/init.d/httpd restart graceful
And with luck you're in business.
sudo vi /etc/httpd/sites.d/example
This will create a new file called example if one doesn't already exist.
(You need an include sites.d/*
in /etc/httpd/conf/httpd.conf)
i
to edit, this is the model (Agaric hasn't tested the subdomain part quite like this, but for just one directory, even if the domain isn't even pointing at your site yet, the IP will work):
<pre>
<VirtualHost 101.01.010.10:80>
ServerName www.example.coop
DocumentRoot /home/example/public_html/main
Options Indexes FollowSymLinks
</VirtualHost>
<VirtualHost 101.01.010.01:80>
ServerName test.example.coop
DocumentRoot /home/example/public_html/test
Options Indexes FollowSymLinks
</VirtualHost>
Shift-ZZ
to save and exit.
And then:
sudo /etc/init.d/httpd restart graceful
And with luck you're in business.
Comments
Post new comment