Page 3 of 7 FirstFirst 12345 ... LastLast
Results 21 to 30 of 63

Thread: 404 Error when use Public IP or Domain Name

  1. #21
    Join Date
    Feb 2006
    Beans
    5,714

    Re: 404 Error when use Public IP or Domain Name

    remove the virtual host stuff from the httpd.conf file, it shouldn't be there as I've said twice. You need to use the virtual host files

    Virtual Hosts

    Apache2 has the concept of sites, which are separate configuration files that Apache2 will read. These are available in /etc/apache2/sites-available. By default, there is one site available called default this is what you will see when you browse to http://localhost or http://127.0.0.1. You can have many different site configurations available, and activate only those that you need.

    As an example, we want the default site to be /home/user/public_html/. To do this, we must create a new site and then enable it in Apache2.

    To create a new site:

    *

    Copy the default website as a starting point. sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite
    *

    Edit the new configuration file in a text editor "sudo nano" on the command line or "gksudo gedit", for example: gksudo gedit /etc/apache2/sites-available/mysite
    *

    Change the DocumentRoot to point to the new location. For example, /home/user/public_html/
    *

    Change the Directory directive, replace <Directory /var/www/> to <Directory /home/user/public_html/>
    *

    You can also set separate logs for each site. To do this, change the ErrorLog and CustomLog directives. This is optional, but handy if you have many sites
    * Save the file

    Now, we must deactivate the old site, and activate our new one. Ubuntu provides two small utilities that take care of this: a2ensite (apache2enable site) and a2dissite (apache2disable site).

    sudo a2dissite default && sudo a2ensite mysite

    Finally, we restart Apache2:

    sudo /etc/init.d/apache2 restart

    If you have not created /home/user/public_html/, you will receive an warning message

    To test the new site, create a file in /home/user/public_html/:

    echo '<b>Hello! It is working!</b>' > /home/user/public_html/index.html

    Finally, browse to http://localhost/
    normally I use the site names when I create the new virtual hosts files.
    Debian Testing(64bit) + XFCE4 AM2 5200+ ATI Radeon HD4350, 4gig RAM,320Gig and 750gig HDs

    what's the difference between an answer and a solution? An answer is what they want to hear, a solution is what they don't want to hear

  2. #22
    Join Date
    May 2010
    Beans
    116

    Re: 404 Error when use Public IP or Domain Name

    Ok I have done that. One thing I noticed when I ran ifconfig. The Web Server was no longer on 192.168.123.101 but had moved to 104. How do I set the box so that it has a static IP of 192.168.123.101? I went into my DynDNS service and set that IP address in the service and am now back to the error message

    Not Found

    The requested URL / was not found on this server.

    Apache/2.2.14 (Ubuntu) Server at wilmingtoncoc.com Port 80

    So I think this tells me it is getting to the box but for some reason, unbeknown to me is not getting to my /SERVER/wilmingtoncoc/index.html file. So what now.

    Again, I appreciate all the help I can get. I am determined to get this going. So I can next figure out how to FTP into this and also put the site up using WordPress.

    I am wondering if there is something missing out of one of my conf files that would direct it to the directory where my index.html file is. I don't know the chain of command from the time a command enters the webserver to finally getting to the index.html file.

    Mike Hughes
    Last edited by macmike; May 27th, 2010 at 03:36 PM.

  3. #23
    Join Date
    Feb 2006
    Beans
    5,714

    Re: 404 Error when use Public IP or Domain Name

    you don't want to enter an IP of 192.168.x.x into DynDNS service, its a non-routable IP address and is only good on your local network, not the internet. You need to use the IP address that your router is getting from your ISP.

    if your router supports it, you can assign IPs based on MAC addresses and leave the computer on DHCP

    what do you have for files in /etc/apache2/sites-available now?
    Debian Testing(64bit) + XFCE4 AM2 5200+ ATI Radeon HD4350, 4gig RAM,320Gig and 750gig HDs

    what's the difference between an answer and a solution? An answer is what they want to hear, a solution is what they don't want to hear

  4. #24
    Join Date
    May 2010
    Beans
    116

    Re: 404 Error when use Public IP or Domain Name

    I have biblematters
    default
    default-ssl
    michaelrhughes (needs to be renamed to mikealrhughes) how do I do that?
    wilmingtoncoc

    A fellow in Washington state was able to get in I think by way of SSH and set this up for me. Just spelled the directory for the mikealrhughes site wrong. My mother didn't know how Michael was suppose to be spelled she asked the nurse and she said spell it like it sounded so they came up with Mikeal. Anyway appreciate your help.

    I am not attempting to move the other 2 sites until I see the wilmingtoncoc site going and able to get content into it through Wordpress. I know this is a big learning curve.

    When I type into my browser on my iMac - 192.168.123.104 I get my index.html file from the wilmingtoncoc directory.
    When I type in wilmingtoncoc.com I get the 404 error back from the Web Server.



    Mike
    Last edited by macmike; May 27th, 2010 at 04:09 PM.

  5. #25
    Join Date
    Feb 2006
    Beans
    5,714

    Re: 404 Error when use Public IP or Domain Name

    after you created the sites-available, did you run
    Code:
    sudo a2ensite wilmingtoncoc
    and
    Code:
    sudo /etc/init.d/apache2 restart
    Debian Testing(64bit) + XFCE4 AM2 5200+ ATI Radeon HD4350, 4gig RAM,320Gig and 750gig HDs

    what's the difference between an answer and a solution? An answer is what they want to hear, a solution is what they don't want to hear

  6. #26
    Join Date
    May 2010
    Beans
    116

    Re: 404 Error when use Public IP or Domain Name

    I just ran the command again to make sure. It returned a message
    Site wilmingtoncoc already enabled

    The restart returns the warnings again
    [warn] NameVirtualHost *:0 has no VirtualHost
    [warn] NameVirtualHost *:80 has no VirtualHost
    Last edited by macmike; May 27th, 2010 at 04:23 PM.

  7. #27
    Join Date
    Feb 2006
    Beans
    5,714

    Re: 404 Error when use Public IP or Domain Name

    can you post the contents of the wilmingtoncoc file in sites-available
    Debian Testing(64bit) + XFCE4 AM2 5200+ ATI Radeon HD4350, 4gig RAM,320Gig and 750gig HDs

    what's the difference between an answer and a solution? An answer is what they want to hear, a solution is what they don't want to hear

  8. #28
    Join Date
    May 2010
    Beans
    116

    Re: 404 Error when use Public IP or Domain Name

    Just index.html
    is listed.
    When I did a sudo nano for the index.html it just says wilmingtoncoc.com
    I believe for some reason the wilmingtoncoc.com is not resolving to that file. But can't figure out why. That is why I was checking my Dyndns stuff and my router settings. I now believe they are ok that it has to be something in the configuration of the Web Server. Some configuration file is not pointed in the right direction. I am green on the operation of Linux that I don't know what files to check. Macintosh, or Windows I would have no problem it is just like learning a new language. I have had that experience 6 times. It is a challenge until one day it clicks and you can think in that language. I have to get to where I can think in Linux but have to learn it before I can think it. Anyway, thanks for your patience with me in this endeavor.

    Why is it I can type in 192.168.123.104 in a URL and get the index.html. But can't when I type in wilmingtoncoc.com. Does sound like a DNS issue somewhere to me I just can't put my finger on where in the Server box that problem would be. Does it go back to the site-enable/wilmingtoncoc file not accepting the NameServer *:80 line?


    Mike
    Last edited by macmike; May 27th, 2010 at 04:31 PM.

  9. #29
    Join Date
    Feb 2006
    Beans
    5,714

    Re: 404 Error when use Public IP or Domain Name

    I'm not looking for the index file, I'm looking for the contents of the file /etc/apache2/sites-available/wilmingtoncoc.com

    it should look like this:
    Code:
    <VirtualHost *:80>
    	ServerAdmin joe@aol.com <change to correct email>
    	ServerName wilmingtoncoc.com
    	ServerAlias wilmingtoncoc.com *.wilmingtoncoc.com
    	DocumentRoot <where ever you have the document root>
    	<Directory />
    		Options FollowSymLinks
    		AllowOverride None
    	</Directory>
    	<Directory <where ever you have the document root>>
    		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>
    Debian Testing(64bit) + XFCE4 AM2 5200+ ATI Radeon HD4350, 4gig RAM,320Gig and 750gig HDs

    what's the difference between an answer and a solution? An answer is what they want to hear, a solution is what they don't want to hear

  10. #30
    Join Date
    May 2010
    Beans
    116

    Re: 404 Error when use Public IP or Domain Name

    Ok here is what is in there

    <VirtualHost *:80>
    ServerName wilmingtoncoc.com
    ServerAlias www.wilmingtoncoc.com
    DocumentRoot /SERVER/wilmingtoncoc/
    </VirtualHost>
    <Directory /SERVERwilmingtoncoc/>
    Options - Indexes FollowSymlinks MultiViews
    AllowOverride All
    Order allow, deny
    Allow from all
    </directory>

Page 3 of 7 FirstFirst 12345 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •