Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

Apache configuration

Sun Jul 29, 2012 10:01 am

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.

User avatar
PIstolero
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty

Re: Apache configuration

Sun Jul 29, 2012 10:08 am

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.

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: Apache configuration

Sun Jul 29, 2012 10:10 am

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.
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

Re: Apache configuration

Sun Jul 29, 2012 10:20 am

@ 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.

User avatar
PIstolero
Posts: 101
Joined: Mon Jul 23, 2012 6:28 am
Location: paradise city, where the grass is green and the girls are pretty

Re: Apache configuration

Sun Jul 29, 2012 10:26 am

Sorry, it is apache2 not 1.x.
In the folder /etc/apache2/sites-enabled/ there should be a file 000-default

User avatar
Jim JKla
Posts: 2218
Joined: Sun Jan 29, 2012 11:15 pm
Location: Newcastle upon Tyne UK

Re: Apache configuration

Sun Jul 29, 2012 10:29 am

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. ;)
Noob is not derogatory the noob is just the lower end of the noob--geek spectrum being a noob is just your first step towards being an uber-geek ;)

If you find a solution please post it in the wiki the forum dies too quick

Hiro
Posts: 78
Joined: Fri Dec 30, 2011 11:09 am

Re: Apache configuration

Sun Jul 29, 2012 10:36 am

That's the file i was looking for Pistolero, just need to edit:

Code: Select all

 DocumentRoot /var/www
Thanks for that, Hiro.

Return to “Beginners”