Monday, September 17, 2007

Notes to Self

We have LAMP installed. Now let's tackle Apache. How to configure your Apache (Apache2 2.2.3-3.2ubuntu0.1)

There are myriads of Howto's out there but this one is mine.

Fire up your firefox, at the URL, type http://localhost/ or http://127.0.0.1/ you should see some website. Good. Now configure the website.

To create your lame or state of the art web site:-
Change Apache default site to your own. Your index.html is going to be stored in /home/some_user/public_html/ (note replace some_user with user name in your system)

Fire up your terminal, call it terminal cutie
now type the following to copy the default site to mysite.

sudo cp /etc/apache2/sites-available/default \
/etc/apache2/sites-available/mysite

Fire up another terminal, call it terminal cutier
now type the following to change the configuration, you can # or rem out the original line before changing it.

gksudo gkedit /etc/apache2/sites-available/mysite

Change DocumentRoot to point to the new location, /home/some_user/public_html/
Change the Directory directive, replace <Directory /var/www/> to <Directory /home/some_user/public_html/>

UPDATE: oh, and take out the Indexes to disable automatic indexing of directory, that's a personal preference of me. I did that by adding # in the front to rem out the original.

#Options Indexes FollowSymLinks MultiViews
Options FollowSymLinks MultiViews

Save the file.

Now deactivate the old site (the default) and activate the new one, mysite
From terminal cutie, type

sudo a2dissite default && sudo a2ensite mysite

To create an index.html under /home/some_user/public_html/
From terminal cutie, type

echo '<b>Hello World!</b>' > \
/home/some_user/public_html/index.html

Finally restart apache by typing at terminal cutie

sudo /etc/init.d/apache2 restart

Now point your browser to http://localhost/ you should see Hello World! I know I did.

Original reference from here.

2 comments:

  1. Anonymous9:18 PM

    You are such a Techno man, I am totally ignorance
    wp2007

    ReplyDelete
  2. You need to know what you need to know. That's good enough. I myself don't know nothing. It's pretty much cookbook way of doing things for me.

    ReplyDelete

Barber Shop in Chinatown

 Nowadays I loathe to have my haircut, that's why I seldom have mine cut, maybe once or twice a year. I went back to Chinatown. I could ...