*nix Thread, Ubuntu Apache newbie in Technical; Hi, I have bought a new machine and installed the latest version of Ubuntu on it. I've installed Apache2, as ...
-
20th May 2010, 10:25 PM #1 Ubuntu Apache newbie
Hi, I have bought a new machine and installed the latest version of Ubuntu on it. I've installed Apache2, as I want to run a few web apps on it.
The problem is that only http://localhost/ will work to get to the root webpage via a web browser. http://servername/ or http://ipaddress/ will not- they simply give a 404 error (from the orginal machine or a networked machine).
I know a few bits about unix, but mostly google stuff off the net. Can't solve this one though!
It's got DHCP, getting an IP off a windows server. It can ping the network fine, and access the web and shared resources.
Any ideas? Thanks.
-
-
IDG Tech News
-
20th May 2010, 10:36 PM #2 
Originally Posted by
rocknrollstar
Hi, I have bought a new machine and installed the latest version of Ubuntu on it. I've installed Apache2, as I want to run a few web apps on it.
The problem is that only
http://localhost/ will work to get to the root webpage via a web browser.
http://servername/ or
http://ipaddress/ will not- they simply give a 404 error (from the orginal machine or a networked machine).
I know a few bits about unix, but mostly google stuff off the net. Can't solve this one though!
It's got DHCP, getting an IP off a windows server. It can ping the network fine, and access the web and shared resources.
Any ideas? Thanks.
I assume you have changed the path for the directory away from the default /var/www?
If you have then you need to chmod the directory you have changed it to, for example chmod 777 /home/folder
-
Thanks to glennda from:
rocknrollstar (21st May 2010)
-
21st May 2010, 06:51 AM #3 
Originally Posted by
glennda
I assume you have changed the path for the directory away from the default /var/www?
If you have then you need to chmod the directory you have changed it to, for example chmod 777 /home/folder
No, I've not changed that (not sure how). It definitely loads var/www/ as I slightly changed the index page, which is reflected by the browser.
-
-
21st May 2010, 07:11 AM #4 Wouldn't give a 404 anyway would be 403
Can you post the contents of /etc/apache2/sites-enabled/default here. We might be able to help more if we can see the configuration of the host.
Last edited by painejake; 21st May 2010 at 10:14 AM.
-
Thanks to painejake from:
rocknrollstar (21st May 2010)
-
21st May 2010, 09:20 AM #5 
Originally Posted by
glennda
If you have then you need to chmod the directory you have changed it to, for example chmod 777 /home/folder
NOOOOO. Under absolutely no circumstances ever should you do this. It is a massive, gaping security problem.
Instead, you should (for the default packages of Apache2) chgrp www-data /home/folder. Or even better, place a symlink to /home/folder in /var/www.
-
-
21st May 2010, 09:25 AM #6 
Originally Posted by
powdarrmonkey
NOOOOO. Under absolutely no circumstances ever should you do this. It is a massive, gaping security problem.
Instead, you should (for the default packages of Apache2) chgrp www-data /home/folder. Or even better, place a symlink to /home/folder in /var/www.
I didn't know the exact chmod command off the top of my head, hence why it was an example - maybe i should have not used a read/write command for my example!
-
Thanks to glennda from:
rocknrollstar (21st May 2010)
-
21st May 2010, 10:01 AM #7 
Originally Posted by
painejake
Wouldn't give a 404 anyway would be 403
Can you post the contents of /etc/apache2/sites-enabled/default here. We might be able to help more if we can see the configuration of the host.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
-
-
21st May 2010, 10:11 AM #8 Seems fine. Do you have any IPTables setup that could stop the connection remotely? You can view these rules with: sudo iptables -L
Can you access it via the server IP from the Ubuntu machine?
Last edited by painejake; 21st May 2010 at 10:14 AM.
-
Thanks to painejake from:
rocknrollstar (21st May 2010)
-
21st May 2010, 10:44 AM #9 
Originally Posted by
painejake
Seems fine. Do you have any IPTables setup that could stop the connection remotely? You can view these rules with: sudo iptables -L
administrator@mtube:~$ sudo iptables -L
[sudo] password for administrator:
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
---------------------------------------------------------------------------------------
Traceroute
Hop Hostname IP Time 1 Time 2
1 mtube.local 10.199.224.187 0.103ms
1 10.199.224.16 10.199.224.16 0.351ms
1 10.199.224.16 10.199.224.16 0.371ms
---------------------------------------------------------------------------------------
Ping the windows server (10.199.224.16)
Bytes Source Seq Time Units
64 10.199.224.16 1 0.083 ms
64 10.199.224.16 2 0.122 ms
64 10.199.224.16 3 0.124 ms
64 10.199.224.16 4 0.122 ms
64 10.199.224.16 5 0.117 ms
Time minimum: 0.08 ms
Time average: 0.11 ms
Time maximum: 0.12 ms
Packets transmitted: 5
Packets received: 5
Successful packets: 100%
---------------------------------------------------------------------------------------
Note that I can ping from a windows machine to the ubuntu machine fine. I can also type in http://10.199.224.187 from a windows machine and it shows up the 'It Works" webpage fine. It's only http://mtube/ that doesn't work from any machine, inc the ubuntu machine.
-
-
21st May 2010, 10:58 AM #10 Oh. Have you setup the DNS settings for mtube in the console on the Windows domain?
-
Thanks to painejake from:
rocknrollstar (21st May 2010)
-
21st May 2010, 11:39 AM #11 Yeah, you need to add an A record for your server in your DNS Namespace..
If your using a microsoft DNS Server, open the dns management, click Forward lookup zones > open your site (school.local) right click and click New Host (A)
Type in your hostname mtube
then type in the ipaddress in the box 10.199.224.187
click okay
now from any windows machine type http://mtube ... Depending on your DNS setup you may need the FQDN ( http://mtube.school.local )
-
Thanks to greenfieldsupport from:
rocknrollstar (21st May 2010)
-
21st May 2010, 12:08 PM #12
- Rep Power
- 6
I would recommend assigning the NIC a static address. this can be done in /etc/networks/interfaces
Personally I would futureproof it and assume you're going to have more than one site on the box. Yoe need to tinker with the /etc/apache2/sites-enabled/000-default file, here's an example:
<VirtualHost *:80>
ServerName www.website1.co.uk
DocumentRoot /var/www/website1
</VirtualHost>
<VirtualHost *:80>
ServerName www.website2.co.uk
DocumentRoot /var/www/website2
</VirtualHost>
the ServerName variable is also known as the host header. This means that visitors can only access that site with that url in their address bar
-
Thanks to prad from:
rocknrollstar (21st May 2010)
-
21st May 2010, 03:56 PM #13 
Originally Posted by
greenfieldsupport
Yeah, you need to add an A record for your server in your DNS Namespace..
If your using a microsoft DNS Server, open the dns management, click Forward lookup zones > open your site (school.local) right click and click New Host (A)
Type in your hostname mtube
then type in the ipaddress in the box 10.199.224.187
click okay
now from any windows machine type
http://mtube ... Depending on your DNS setup you may need the FQDN (
http://mtube.school.local )
OK, well http://mtube can be accessed from a windows machine, but not from ubuntu itself (the host machine). Any ideas?
-
-
21st May 2010, 11:48 PM #14 Added the proxy exception in firefox?
-
SHARE:
Similar Threads
-
By matthewk1971 in forum General Chat
Replies: 5
Last Post: 13th August 2009, 01:37 PM
-
By Seal-Tech in forum Virtual Learning Platforms
Replies: 3
Last Post: 18th June 2009, 05:16 PM
-
Replies: 7
Last Post: 12th May 2009, 12:19 PM
-
Replies: 9
Last Post: 25th March 2008, 07:13 PM
-
By angelsea in forum General Chat
Replies: 1
Last Post: 27th March 2007, 05:39 PM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules