SUPPORT THE SITE WITH A CLICK

Subscribe Rss:

SUPPORT THE SITE WITH A CLICK

Saturday, July 9, 2011

Apache configuration for hosting static files

Configuring apache for hosting files seems to be easy now.Previously i have made a article about apache hosting.Now installing and hosting the files seems to be ease.

If you are ubuntu user, then you can install it from Synaptic.Once installed, then restart your pc machine.When you start the apache server, if you face any problems like this "apache2: Could not reliably determine the server's fully qualified domain name" then checkout this article.

Here i need the host the static files which is located under my home directory /home/jude/web/.
First copy the default site configuration
sudo  cp /etc/apache2/sites-available/default /etc/apache2/sites-available/web

Then edit the configuration file web and change the DocumentRoot to static files path /home/jude/web/.Finally change the directory directive, replace to .

Initially the sites-enabled directory will have the default conf as
root@Vaio:/etc/apache2/sites-enabled# ls -lr
000-default -> ../sites-available/default
Now we must deactivate the old site configuration and activate the new web one.For activating please use the below commands
$/etc/apache2/
$sudo a2dissite default && sudo a2ensite web
Finally, restart the apache server and browse the site via localhost

No comments :

Post a Comment