WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Site works fine when logged on directly to the server (7 posts)

  1. TonyR63
    Member
    Posted 11 months ago #

    I installed WordPress 3.5.1 on my Apache2.15 server on my home network. The Apache server currently hosts 3 web sites – Mythweb, Moodle 2.02, and WordPress just installed.

    In my /var/www/ folder I have 3 folders Moodle, Mythweb and WordPress.
    When I connect to all the sites when logged into the server directly everything works fine however from each of my client machines, whether running windows IE8 to Ubuntu 10.10 and Firefox I can connect to the word press site //Servername/wordpress/ however the client machines load a text based version of the home page. If I select the logon link it fails “not found at localhost port 80 as it attempts to connect to //localhost/wordpress/wp-login.php however if on the browser I replace localhost with the servers hostname it navigates to again a test file version of the login page. It is like the CSS is not applied.

    Two issues here 1) – Styles not applied when clients connect and 2) it is not navigating using localhost from client machines.

    I noticed that the setup instruction seems to suggest that the 17 files in the root of the wordpress download extract need to be in the www root whereas in my installation they are in the www/wordpress folder. What it actually says to copy all except the wordpress folder without explicitlly mentioning its root contents. You would not normally expect to scatter files in the WWW root of a shared server but is this what I need to do to resolve? This part of the installation instructions is very poor as they mention to not copy the wordpress folder with no mention of the 17 files it contains. A few example directory structures showing a few different scenarios would be so helpful but are missing so you are left to interpret the meaning of text.

    I find it strange that it all works perfectly when logged on direct to the server which has virtual hosts configured for all 3 sites configured in the HTTPD.conf file. This file should apply equally to all client machines on the same LAN accessing the same wordpress site including the server itself. These is obviously something I am missing and any suggestions would be most appreciated.

  2. ClaytonJames
    Member
    Posted 11 months ago #

    Your description and the errors seem to suggest that the issue may be related to installing WordPress using "localhost" in your WordPress URL's. - I'm assuming you might have installed WordPress from the browser located on the server itself, using the //localhost/wordpress/wp-admin path to run the install routine.

    That's probably why it works okay from the server, but not from the LAN. I'm guessing it (WordPress) might need at least a static ip address (the static internal network ip address of the server?) or a resolvable domain name in order to display properly from your LAN.

  3. TonyR63
    Member
    Posted 11 months ago #

    Hello

    Thank you for your response CJ and I'm sure that you are absolutely correct. Since the installion steps for WordPress are so sparce I don't remember where I might have defined "Localhist" rather than the server's static IP adress as the server has always had a static IP number reserved for this machine as you do with most servers. I would have been looking for the opportunity to assign WordPress the host name of the server however the WordPress installation procedure does not run an install wizard you just get suggestions about copying files to a location and written in a way that is open to misinterpretation.

    I followed the instruction as written and do you know what file I need to edit to assign WordPress the host name or static IP of my server so that all clients can connect? I have not found any Apache2 file that would hold such a setting and the WP-Conf.php file only has a setting for the MySQL dB which is "Localhost". Should I change this to the host name or the IP number of the server. Can I use just the host name or does it have to be the FQDN?

    There is nothing in the WordPress doco that says that this should ever be anything other than "localhost" but the documentation is not very comprehensive.

    Thanks for your assistance and kindest regards.

  4. ClaytonJames
    Member
    Posted 11 months ago #

    I followed the instruction as written and do you know what file I need to edit to assign WordPress the host name or static IP of my server so that all clients can connect?

    There are no configuration files in WordPress where you would normally define a static ip or hostname. The WordPress URL is set at the time of installation, and then will be reflected in the General settings afterward. It can be changed from there after installation, but that includes some detail that we may not want to be concerned with at this point. Reference: Changing The Site URL - and - Moving WordPress

    This is the often the point where the line that distinguishes the difference between server administration and configuration issues, and WordPress installation, gets blurred. Without knowing what you've done to prepare your server, and if - or - how your Apache virtual host containers are configured, (which are server preparation issues, rather than WordPress issues) I might suggest two things that could get you pointed in the right direction.

    - If you have a domain name that already properly resolves to your server, then try installing WordPress from a machine other than the server itself - or if you must install from the server, try using your domain name in the browser when you run the install.

    Example: If you've installed all of your WordPress files at /var/www/wordpress, then point your browser to //yourdomainname.com/wordpress/wp-admin and install WordPress from there.

    - If you don't have a domain name that will resolve to the server, then you might try doing the same thing using the internal ip address of the server instead.

    Example: Point your browser to //192.x.x.x/wordpress/wp-admin and run the install. Then you should probably be able to access your WordPress site just from your LAN.

    WP-Conf.php file only has a setting for the MySQL dB which is "Localhost". Should I change this to the host name or the IP number of the server

    No. If MySQL is running on the same machine/server as Apache, don't change it. localhost in this case, refers to where your database can be found.

    Some pretty straight forward installation ideas and tips that should apply to any properly configured web server can be found here: Famous 5-Minute Install

    I hope something I mentioned helps point you in a productive direction.

  5. TonyR63
    Member
    Posted 11 months ago #

    Hello CJ

    I can get the client machines to connect to the WordPress site if on each client machine I manually write a hosts files entry reassigning Localhost to the servers IP number. This should not need to be done but is a work-a-round. This would prevent a client from ruuning HTTP applications locally with wold be an issue for one machine in particular as it is used for web development.

    You wrote "you would normally define a static ip or hostname. The WordPress URL is set at the time of installation" which I presume is part of step 4 in the installation instructions - running the installation script. It appears to me that I cannot rerun the same script to correct this entry so i need to know where that script writes to. It must be in a file somewhere. Most installation scripts have reinstall options that I cannot find in ths case.

    I agree with your comment that this is more an administration issue than installation however the instructions seem to assume no one has their own environments and are all are using ISP hosted services. A small section covering possible Apache2 configurations would not go amiss.

    My VirtualHost *:80 settings are all in proper order or else it would not be working OK even when logged on to the server.

    Your feedback and suggestions have been very helpful and I am most grateful for your assistance.

    I will review the links you have provided and I feel close to a resolution.

    Many Thanks

  6. ClaytonJames
    Member
    Posted 11 months ago #

    It appears to me that I cannot rerun the same script to correct this entry so i need to know where that script writes to.

    You can't re-run the installer because you've already completed the routine and added the information you provided to your database. You can of course, edit that information using your database administration tools. Reference: Changing The Site URL. But if you've just installed and have no content yet, it's much more convenient to simply delete the tables in your WordPress database. That will allow you to run the install routine again.

    It must be in a file somewhere. Most installation scripts have reinstall options that I cannot find in ths case.

    It's not in a file. The information is stored in the database you created for wordpress.

  7. TonyR63
    Member
    Posted 9 months ago #

    Just changing the host name in the admin interface from Localhost to the actual server name fixed this issue thanks

Reply

You must log in to post.

About this Topic