Home > Small Biz > How to: Redirect Apache’s Default www or public_html Folder to a Directory in Your Home Folder « damontimm.com

How to: Redirect Apache’s Default www or public_html Folder to a Directory in Your Home Folder « damontimm.com

How to: Redirect Apache’s Default www or public_html Folder to a Directory in Your Home FolderPurpose: The default installation of Apache from a Ubuntu-Server installation sets the base directory for the web documents as /var/www on Ubuntu’s installation — this may be different if you are running Apache on another machine; this may not be where you want it, in the end, and certainly isn’t as easily accessible from a remote machine. One option is to change where it is Apache searches for its web documents folder in Apache’s configuration file; another way, which I chose, is to create a symbolic link in the default location’s place and have it point to a directory in my user’s home folder.Benefit: I can login remotely with my user name henry and have direct access to the web documents root folder. This makes it easy to use FTP or SSH or AFP to move files around and I don’t have to fool with user groups or permissions.If you want to do this, login as the user you want to host the web pages and run the following from the terminal:

$ mkdir ~/www

$ sudo mv /var/www /var/www-backup

$ sudo ln -s /home/’your home id’/www /var/www

This will create a www folder in your user’s home directory, change the name of Apache’s default www directory, and create a symbolic link in its place that points to the directory you recently created.

Drop a index.html file in your new ~/www directory and you are good to go!

this entry was posted on friday, october 13th, 2006 at 2:39 pm and is filed under how to. you can follow any responses to this entry through the rss 2.0 feed. you can leave a response, or trackback from your own site. tags: apache, linux, ubuntu.

via How to: Redirect Apache’s Default www or public_html Folder to a Directory in Your Home Folder « damontimm.com.

Advertisements
Categories: Small Biz
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: