Results 1 to 8 of 8
  1. #1

    How can I http access a server without a domain?

    Hi, I've setup a dedicated server that is currently running with a domain bound to it. However this time I want to setup a centos 5.1 + latest apache 2 + bind 9 server that can only be connected to by IP address and doesn't have a domain name. So what do I need to modify in the below files to do so:

    First of all will I even need bind at all? I already have it setup and (mis-)configured but I guess if I don't need it I can just take if off of autostart and stop the process "named".

    options {
    pid-file "/var/named/chroot/var/run/named/";
    directory "/var/named/chroot/var/named";
    query-source address * port 53;
    allow-query { any; };
    allow-transfer { };
    recursion no;
    notify no;
    version "unknown";
    logging {
    category default { null; };
    zone "" { type master; file ""; };
    I don't even want the zone have in its name but that's just there so I could show you how I'd include
    $TTL 14400
    @       IN      SOA (
                                                    86400 )    14400    IN    NS    14400    IN    NS
    localhost    14400    IN    A
    www    14400    IN    A
    I'm not sure what to do about those references to here, they shouldn't be needed but without them I don't know what to put here. ^^
    Obviously I can't use those nameservers...

    The only thing missing from this file is "search" at the top, is that needed even though I won't really have any domains used by this server?

    # Do not remove the following line, or various programs
    # that require network functionality will fail. domain localhost.localdomain localhost
    ::1        localhost6.localdomain6 localhost6
    I never did these:
    * Change /etc/sysconfig/network file's HOSTNAME to
    I didn't do them because I don't know what to use as a hostname when I don't have a domain.

  2. #2
    Join Date
    May 2007
    If you just want to have Apache serving pages off of the IP address of the server, you don't need to involve Bind at all (really, even if you wanted to use a domain name you don't necessarily need Bind either - you can use your hosting providers DNS services or a third party such as DynDNS).

    For most distributions, Apache is installed to automatically listen to port 80 on the server's IP address. This is easy to check - just point your browser at your IP address. If you don't get a default page back, check the httpd.conf - it should be easy to correct.

  3. #3
    Okay, bind removed but it gives this error message when starting apache:

    [Mon Mar 10 14:28:52 2008] [warn] module php5_module is already loaded, skipping
    [Mon Mar 10 14:28:52 2008] [error] (EAI 2)Name or service not known: Failed to resolve server name for (check DNS) -- or specify an explicit ServerName

    In addition, when I try to access a test file on my server, it says Access Forbidden 403, even though the httpd.conf says to allow it.

  4. #4

    You don't really need the concept of bind or named if you don't have domain name. I hope your IP is dedicated and if you access the IP it will reach the servers apache conf and there it searches for document root and it displays the page.

  5. #5
    Yes, the IP is dedicated. If I go to my server's IP, it will just say access forbidden.

    So now I still need to know how to change the /etc/hosts file and if I should do anything about these:

    * Change /etc/sysconfig/network file's HOSTNAME to

  6. #6
    I changed etc/hosts to the following:

    # Do not remove the following line, or various programs
    # that require network functionality will fail. IS-3995 IS-3995 localhost.localdomain localhost
    ::1 localhost6.localdomain6 localhost6

    And now apache doesn't display that error anymore. However access is still forbidden. Below is my httpd.conf without comments.

    ServerRoot "/usr/local/apache2"
    Listen 80
    LoadModule php5_module modules/
    LoadModule flvx_module modules/
    <IfModule !mpm_netware_module>
    User daemon
    Group daemon
    ServerAdmin [email protected] # NOT REALLY
    DocumentRoot "/home/freesexd/www"
    <Directory />
        Options FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
    <Directory "/home/freesexd/www">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    <IfModule dir_module>
        DirectoryIndex index.html index.php
    <FilesMatch "^\.ht">
        Order allow,deny
        Deny from all
        Satisfy All
    ErrorLog logs/error_log
    LogLevel warn
    <IfModule log_config_module>
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
        LogFormat "%h %l %u %t \"%r\" %>s %b" common
        <IfModule logio_module>
          # You need to enable mod_logio.c to use %I and %O
          LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
        CustomLog logs/access_log combined
    <IfModule cgid_module>
    DefaultType text/plain
    <IfModule mime_module>
        TypesConfig conf/mime.types
        AddType application/x-compress .Z
        AddType application/x-gzip .gz .tgz
        AddType application/x-httpd-php .php
        AddHandler flv-stream .flv
    Include conf/extra/httpd-vhosts.conf
    <IfModule ssl_module>
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    Below is conf/extra/httpd-vhosts.conf
        DocumentRoot "/home/freesexd/www"
        UseCanonicalName Off
        CustomLog /var/log/httpd/ bytes
        CustomLog /var/log/httpd/ combined
        ErrorLog /var/log/httpd/
        <Directory /home/freesexd/www>
        ErrorDocument 404 /404.html
        ErrorDocument 401 /401.html
        Options -Indexes FollowSymLinks
        php_admin_value sendmail_path '/usr/sbin/sendmail -t -i'

  7. #7
    Still not resolved, I get these kind of errors in my error log:

    [Mon Mar 10 16:33:41 2008] [crit] [client] (13)Permission denied: /home/freesexd/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

    I even tried putting an empty .htaccess file there and to /home/freesexd/www but neither helped and .htaccess file shouldn't need to exist anyway, right?

  8. #8
    DOH, finally resolved it. I just had 700 permissions on the /home/freesexd folder.
    Thanks guys for the help anyway.

Posting Permissions

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