Reputation: 642
First of all, I'm on ubuntu 12.10 and running latest apache patch. I know how to access the default localhost directory of my server from other computers. When I type in 192.168.1.** in a different computer, I can access the /var/www/ directory.
But what if I want to appoint that to a different directory? Where and how do I modify it? hosts, conf.d etc? And how can I access it with a domain name instead of the IP? Thanks ahead.
Upvotes: 0
Views: 410
Reputation: 6366
Look in /etc/apache2/sites-available
. You will most likely find a file named default
and another named default-ssl
. The DocumentRoot
can be changed within this file. Remember to restart Apache...
sudo service apache2 restart
Or...
sudo apache2ctl graceful
Or...
sudo /etc/init.d/apache2 reload
It's not unusual to have several virtual hosts listed in sites-available
, and remember that these configs have to have symbolic links in sites-enabled
in order to be seen by Apache.
A Virtual Host file looks something like this...
Listen 80
<VirtualHost *:80>
DocumentRoot /www/example1
ServerName www.example.com
# Other directives here
</VirtualHost>
Further reading: Apache Documentation - Virtual Hosts
Upvotes: 1