Quick and dirty guide on configuring apache web server? Building basic website?

dalearyous

Senior member
Jan 8, 2006
836
0
0
i installed ubuntu server edition on my old athlon xp machine. i then installed the ubuntu desktop package so i could have a gui to work with. i then installed webmin and tested to make sure i could login and it works just fine. right now i have the server setup with just a local static IP address (192.168.1.xxx) and when i first started if i typed that into my browser on any machine on the network i would get a real basic web page stating "It works!" so i tried editing the index.html file that i thought was associated with it using the root username and it stopped working...

so, i know i need to do a lot more reading. most web development and php stuff i have done was in windows and if it compiled and ran i was pretty much done. however, the linux environment is definitely different and i can't seem to figure out where the source files are for the apache 2 web server. so can anyone point me to a place where they have a simple guide on how to get started and organized to host a website? ill start with just a website locally. ill mess with domains and dynamic dns stuff later.

the ideal guide would basically map out the directory for where the .html files should go etc... and what i need to do to properly setup the apache server and walk me through basic website changes and how to view them. (side note: i did install screem editor)

any advice or help would be appreciated.
 

Kakumba

Senior member
Mar 13, 2006
610
0
0
There is TONNES of info about apache.

Firstly, on Ubuntu, you normally put stuff into /var/www/ (I think that's the default location, I don't do Ubuntu). Anyway, that's configurable (along with everything else) in your httpd.conf, which would be located in /etc/apache2. But I think Ubuntu does things different, so check the readme, and look at what is in the /etc/apache2. The out of the box config should work on your local network, by jsut putting your stuff into the /var/www directory, or something under there.

There is info here: http://httpd.apache.org/

Or try howtoforge, there are tonnes of starter guides on there, step by step stuff which will help.

 

dalearyous

Senior member
Jan 8, 2006
836
0
0
ok thanks. i have been googling for passed few hours and although some of it is helpful, i was hoping someone with experience had a know it all awesome website
 

dalearyous

Senior member
Jan 8, 2006
836
0
0
i think i am struggling with something simple, i have followed 3 different noob guides but when i create my test.php file in /var/www folder and then type in the ip 192.168.1.XXX/test.php i get 404 Not Found. the requested URL/was not found on the server
Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.3 with Suhosin-Patch Server at localhost Port 80

side note: not relevant, i got myphpadmin working by going to localhost/myphpadmin
 

Netopia

Diamond Member
Oct 9, 1999
4,793
4
81
Just a couple of thoughts...

Are the permissions on the folder and file set so that apache can read them?

Have you gone through httpd.conf and made sure of where your document root is?

Joe
 

Brazen

Diamond Member
Jul 14, 2000
4,259
0
0
You don't want to look in httpd.conf. You need to look at /etc/apache2/sites-available/default but I can tell you the default root is indeed /var/www. It really sounds like you have a permissions issue. By default the files should be readable by everyone, but you might check that and/or change the group to www-data and make sure group has read permission.

For more information, look here: help.ubuntu.com
There is a link for server documentation and there you will find information on using Apache.
 

Crusty

Lifer
Sep 30, 2001
12,684
2
81
There are a million different ways to configure apache. Since you are using one IP address for the server you either need to reconfigure the /etc/apache2/sites-available/default website to recognize your new file/folder path or you need to create a new website configuration file and place it in /etc/apache2/sites-available. The caveat with the 2nd way is that you need to setup VirtualHosts in order to serve more then one site on a single IP address, the caveat with the first way is that Ubuntu is expecting that to be a default for it's various web software packages.

If you decide to go with VirtualHosts, once you have your new site configuration in /etc/apache2/sites-available/ just type a2ensite myNewSite to enable it. Obviously change myNewSite to the name of the file you saved your configuration as. Once that is done, sudo /etc/init.d/apache2 force-reload will load your new configuration changes into apache and you should be working.

Without some more details about what you are going to host, and what kind of flexibility you want it's hard to give specifics about the actual stuff in the configuration files because there are just so many ways to configure apache.
 

dalearyous

Senior member
Jan 8, 2006
836
0
0
well i gave up and reinstalled ubuntu. after poking around and making sure everything was working fine i am pretty sure it wasn't working because i did not have a virtual server setup pointing to the right directory. so everything seems to be fine now. i can create .html and .php files and view them using localhost or static ip from any computer on the network...

however, when i go to edit the index.html file in /var/www i can never save my changes... i know it has something to do with permissions and the way i got around it last time was enabling local system admin to login at login screen and i used the user root. however, i have read thats not a very secure way to do it and without using sudo in the command prompt i don't know how to give my main user rights to create/edit files...help?
 

dalearyous

Senior member
Jan 8, 2006
836
0
0
thanks for the guide, i had stumbled upon that in my searches. finally got it up and running. ran into a quick problem with verizon blocking port 80. so i changed the port on the server and went to no-ip.com and made a few changes and had the port changed to 8080 and now its public.