I have ubuntu 10.10 installed, and when I hit my IP I see:
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
Where should I look to see where this is being served from?
The strange thing is, I just installed nginx and setup a static page that is served on port 80 also (should be conflicting with the default apache that is serving the 'it works page'), when I restart nginx I don't get bind error sayign port 80 is already taken.
I dont' use apache, and don't want it but the default install seems to have it. I ahve no idea where it is, I don't see it in /opt or etc/apache .
thanks!
you can put your webpage in
/var/www/
you will need sudo access to be able to change anything there.These are your options to do so.
1. Use mv on a file
You could use the terminal and the command
mv
.Example:
cd /var/www/
mv ~/Desktop/FILENAME.html .
The dot isn't a misstake, it's that the destination is the current folder.
2. use a text editor
Another way to do it is just to open
gedit
(or any other editor) and save your file in/var/www/
.if you want to remove apache you could just type
sudo apt-get remove apache
in a terminal. If you are usingapache2
then add a2
to the ending.3. Make a link to the root folder
And if you are tired of having to use the root user to add a new webpage document, jsut make a link. Configuring Permissions for FTP and Apache
By the way, you don't need to go to your IP, you can just go to your
localhost
in your browser. If you have several files in your folder, just add a file name like this:localhost/myfile.html
By default when to tell your browser to display "localhost" Apache will look in /var/www for a site to display. After a new Apache install it will find an index.html file. That is the file that displays the message you see. Index.html is the name normally used for the home page of a site. If no index.html file is in /var/www a directory listing of the files there will be displayed. You can replace the original index.html with an HTML file of your own. Don't forget that /var/www is owned by root.
You can use synaptic to find all apache files and see where they are. First search for Apache, then right click on the package(s) and click properties. Select the installed files tab to see where the files are.
Apache stores its sites in
/etc/www
.As Fragos explains above; Apache will look in
/var/www
for a site to display. Apache looks for files commonly associated with a homepage such asindex.php
, after a new Apache install it will find anindex.html
file (this contains the text you see mention in the post).Fragos is right that you can simply amend this file or you can delete it and create your page as you see fit ensuring you name it in a way that apache will find and serve this file as a the page. By naming it
index.html
, apache will prioritise this file to serve over any other file in the directory level/var/www
.If you want Apache to serve from a different directory i.e. a sub directory as can be used in Wordpress then you will need to match/configure the path/DocumentRoot in the respective virtual hosts file, which depending on OS can be found by
cd/ete/apache2/**yourwebsitefolder**/sites-enabled
& thensudo nano into 000-default.conf
(unless you have created a dedicated Vhost for the website in question). You need to add;ServerName www.yourwebsite.com
ServerAlias yourwebsite.com
DocumentRoot
enter the full path (1 level above) the website file to be loaded i.e. /var/www/yourwebsitefolderNote the above example path assumes your homepage/index.html is nested inside
yourwebsitefolder
. Note Wordpress would have "index.php" as it's alternative toindex.html
and this is what Apache will look/try to serve as a priority.Now restart apache2, clear cache on your web broswer (to avoid potentially seeing a cached webpage). Now when you enter your site's name you should see the desired site - this is for internal netowrks/LAN, further steps required to make site accessible on the internet.
To access externally/internet you need to consider other aspects such as a domain name, port forwarding/secure host server, firewalls etc. This leads onto another sub topic which is easily found by amending your question accordingly.