Support » Fixing WordPress » Hosting a Wordress site myself and stumbling on host header info

  • Hello –

    I want to build a new website on my own servers and once I understand what I’m doing, I want to make it visible over the public Internet. So for right now, everything is internal.

    My web host is a Fedora 18 system at IP Address 10.10.10.4. My website content for now is a couple of test pages and lives in a directory tree under /usr/share/wordpress/. My WordPress config files live in /etc/httpd/conf.d.

    I set up an internal DNS name, http://www.infrasupport.local., pointing to 10.10.10.4, and have a corresponding reverse DNS entry.

    When I launch a browser and go to http://10.10.10.4/wordpress/wp-admin, I can login to the WordPress dashboard and tinker with content. My experiments show up on my website as expected as long as I stick with raw IP Addresses.

    And when I go to http://www.infrasupport.local, I also see my latest website handiwork. So far so good. Well, sort of. My website has a menu and a couple of test pages. When I click on any menu item, it goes to 10.10.10.4/wordpress/{page}, instead of http://www.infrasupport.local/{page}.

    Here is my biggest challenge. When I go to http://www.infrasupport.local/wp-admin, I get my website header and the bottom of the page tells me about an “embararrasing” page not found error. It should send me to the dashboard login, just like 10.10.10.4/wordpress/wp-admin does.

    What I hope to accomplish is, put together a usable prototype website, then eventually make it live by setting up public DNS entries to a .com domain and doing appropriate NAT on my firwewall. This means the names will be .local while I’m learning and developing and will transition to .com when I feel good about making it public.

    I think I am missing something in my config files, but not sure what. My httpd.conf is right out of the box from the Fedora RPM. Here is what wordpress.conf looks like:

    ‘[root@webf18 conf.d]# more wordpress.conf
    Alias /wordpress /usr/share/wordpress

    <Directory /usr/share/wordpress>
    ## AllowOverride Options
    AllowOverride All
    <IfModule mod_authz_core.c>
    # Apache 2.4
    Require local
    Require ip 10.10.10
    </IfModule>
    <IfModule !mod_authz_core.c>
    # Apache 2.2
    Order Deny,Allow
    Deny from All
    Allow from 127.0.0.1
    Allow from ::1
    </IfModule>
    </Directory>

    <Directory /usr/share/wordpress/wp-content/plugins/akismet>
    <FilesMatch “\.(php|txt)$”>
    Order Deny,Allow
    Deny from all
    </FilesMatch>
    </Directory>’

    I also set up infrasupport.conf, like this:

    ‘<VirtualHost http://www.infrasupport.local:80&gt;
    ServerAdmin gregscott@infrasupport.com
    DocumentRoot /usr/share/wordpress/index.php
    ServerName http://www.infrasupport.local:80
    ## ErrorLog “/usr/share/wordpress/logs/error_log.log”
    ## CustomLog “/usr/share/wordpress/logs/access_log.log” combined

    Alias /wordpress /usr/share/wordpress

    <Directory /usr/share/wordpress>
    ## AllowOverride Options
    AllowOverride All
    <IfModule mod_authz_core.c>
    # Apache 2.4
    Require local
    Require ip 10.10.10
    </IfModule>
    <IfModule !mod_authz_core.c>
    # Apache 2.2
    Order Deny,Allow
    Deny from All
    Allow from 127.0.0.1
    Allow from ::1
    </IfModule>
    </Directory>

    </VirtualHost>’

    Hopefully I did those backticks properly so the config files are not butchered.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter gregscott

    (@gregscott)

    Aw nuts – Let me try to post those config files again. This time clicking the “code” button and maybe the indents will work.

    First, wordpress.conf (in /etc/httpd/conf.d)

    [root@webf18 conf.d]# more wordpress.conf
    Alias /wordpress /usr/share/wordpress
    
    <Directory /usr/share/wordpress>
    ##  AllowOverride Options
      AllowOverride All
      <IfModule mod_authz_core.c>
        # Apache 2.4
        Require local
        Require ip 10.10.10
      </IfModule>
      <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order Deny,Allow
        Deny from All
        Allow from 127.0.0.1
        Allow from ::1
     </IfModule>
    </Directory>
    
    <Directory /usr/share/wordpress/wp-content/plugins/akismet>
      <FilesMatch "\.(php|txt)$">
        Order Deny,Allow
        Deny from all
      </FilesMatch>
    </Directory>

    Now infrasupport.conf (also in /etc/httpd/conf.d)

    [root@webf18 conf.d]# more infrasupport.conf
    <VirtualHost www.infrasupport.local:80>
        ServerAdmin gregscott@infrasupport.com
        DocumentRoot /usr/share/wordpress/index.php
        ServerName www.infrasupport.local:80
    ##    ErrorLog  "/usr/share/wordpress/logs/error_log.log"
    ##    CustomLog "/usr/share/wordpress/logs/access_log.log" combined
    
    Alias /wordpress /usr/share/wordpress
    
    <Directory /usr/share/wordpress>
    ##  AllowOverride Options
      AllowOverride All
      <IfModule mod_authz_core.c>
        # Apache 2.4
        Require local
        Require ip 10.10.10
      </IfModule>
      <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order Deny,Allow
        Deny from All
        Allow from 127.0.0.1
        Allow from ::1
     </IfModule>
    </Directory>
    
    </VirtualHost>

    thanks

    – Greg Scott

    Thread Starter gregscott

    (@gregscott)

    Trying to follow the directions in
    http://codex.wordpress.org/Changing_The_Site_URL

    I made an even bigger mess.

    First, in wp-admin, I went to Settings…General and changed my WordPress Address URL and Site Address URL from http://10.10.10.4:/wordpress to http://www.infrasupport.local.

    Trying to visit my test website generated output I can only describe as strange. My opening page came up, but when I clicked on any link to my test pages in the menu, it expanded the test pages below the opening page, keeping the opening page in place. And wp-admin gave me that embarrassing error again. Trying to load the page with raw IP Addresses also broke.

    I am using the TwentyTwelve theme, so following that Changing_The_Site_URL advice, I went to my Fedora server, navigated to /usr/share/wordpress/wp-content/themes/twentytwelve and edited functions.php. I inserted these lines right below the opening <?php line:

    update_option('siteurl','http://10.10.10.4:/wordpress');
    update_option('home','http://10.10.10.4:/wordpress');

    And now I can get to everything in my browser again by raw IP Address.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hosting a Wordress site myself and stumbling on host header info’ is closed to new replies.