Page 1 of 1

Apache configuration

Posted: Sun Jul 29, 2012 10:01 am
by Hiro
I am trying to host a web site on my Pi so i installed apache.

Code: Select all

sudo apt-get install apache2
Started the service

Code: Select all

sudo /etc/init.d/apache2 start
Did a google for apache configuration to find out where to put the web pages and found i needed to edit the "documentroot" line in the httpd.conf file. Problem is i don't have that file anywhere, i assume httpd is a daemon? if so it is not installed and running but apt-get tells me it cannot be installed but is part of apache2, is this correct?
I think apache may be working ok as if i type http://localhost into midori i get the "It works" page which i seem to think is an apache thing?
I'm a little confused so any help would be appreciated.
Cheers, Hiro.

Re: Apache configuration

Posted: Sun Jul 29, 2012 10:08 am
by PIstolero
I never installed apache on a Pi but on debian (raspbian is based on debian) the config file is apache2.conf (not httpd.conf); it should be in /etc/apache2.

Re: Apache configuration

Posted: Sun Jul 29, 2012 10:10 am
by Jim JKla
If you got the it works page it sounds good.

Code: Select all

sudo su
that makes you super user

Code: Select all

cd /var/www
go to the dark place where your web pages for apache are

Code: Select all

ls
this is the eqivilent of the old dos dir command you can use nano to edit the html and play in general.
remember you may need to chmod 755 "the file name" to make new html's public readable if it's a new file but thats basic web page stuff.

Re: Apache configuration

Posted: Sun Jul 29, 2012 10:20 am
by Hiro
@ Pistolero The apache2.conf file is present but there doesn't seem to be anywhere that tells my where the html files should be stored.

@Jim JKla That does seem to be where they are stored but i would really like to store them somewhere else. I suppose i could just link the directory but i feel there must be a line somewhere in some config file
to change that?
Thanks for the help, Hiro.

Re: Apache configuration

Posted: Sun Jul 29, 2012 10:26 am
by PIstolero
Sorry, it is apache2 not 1.x.
In the folder /etc/apache2/sites-enabled/ there should be a file 000-default

Re: Apache configuration

Posted: Sun Jul 29, 2012 10:29 am
by Jim JKla
You can store them somewhere else then you need to set up a symbolic link then you can have them in your home directory whatever.

As fo setting up sybolic link info thats kind of generic linux and there's loads of info on the net. ;)

Re: Apache configuration

Posted: Sun Jul 29, 2012 10:36 am
by Hiro
That's the file i was looking for Pistolero, just need to edit:

Code: Select all

 DocumentRoot /var/www
Thanks for that, Hiro.