• Hi all,
    I am a new wordpress user also if a have been programming in php and html from time.

    I installed locally wordpress about 1 month ago, and all gone well. Morever I have four virtual hosts on my PC a WAMP environment and I use Netbeans to create web pages, on Windows 10.

    Some days ago however I noticed that after the wordpress installation, the virtualhost address changed: for example to open the homepage I wrote mysite.dev/ only, but now the correct address is localhost/mysite.dev/. If I digit mysite.dev I have an ERR_CONNECTION_REFUSED on https://mysite.dev.
    File hosts and the other configuration files are unchanged.

    Do you have any idea on what happened? Is it a correct behaviour for virtualhosts?

    Sorry if my English is not so clear.
    Many thanks in advance.

    • This topic was modified 6 years, 9 months ago by fendervr. Reason: typo error
Viewing 9 replies - 1 through 9 (of 9 total)
  • I think you intended:
    dig mysite.dev
    instead of digit

    Do you have SSL installed ? https or http ?

    Which method did you use to install WordPress ?

    Do the netbeans websites still work ?

    Please check, what is in your “hosts” file ?

    Please try each of these:

    http://mysite.dev/readme.html
    http://localhost/mysite.dev/readme.html

    Does the HTML file display ?

    Thread Starter fendervr

    (@fendervr)

    Thanks Ross for your reply and help. Below you can find my answers.

    I think you intended: dig mysite.dev instead of digit

    Sorry I wrote in English thinking in Italian. I meant: If I type “mysite.dev” I have an ERR_CONNECTION_REFUSED and the browser (Chrome) display “https://mysite.dev” within the address bar

    Do you have SSL installed ? https or http ?

    Sincerely I don’t know. I think no, or I have installed it unintentionally.

    Which method did you use to install WordPress ?

    Manual (unzipped archive in the root subdirectory “wordpress”)

    Do the netbeans websites still work ?

    Yes, if I run index.php from inside Netbeans, it is correctly displayed but in the browser address bar appears “http://localhost/mysite.dev/index.php”.

    Please check, what is in your “hosts” file ?

    among others: 127.0.0.1 mysite.dev

    Please try each of these:
    http://mysite.dev/readme.html
    http://localhost/mysite.dev/readme.html
    Does the HTML file display ?

    Due to my configuration I tried:
    http://mysite.dev/wordpress/readme.html: in this case in the browser address bar appears “https://mysite.dev/wordpress/readme.html” and I have an ERR_CONNECTION_REFUSED.
    http://localhost/mysite.dev/wordpress/readme.html: in this case in the browser address bar appears “http://localhost/mysite.dev/wordpress/readme.html” and the webèage is perfectly displayed.

    Thanks again

    Claudio

    Could you list the apache2 configuration files that include the “VirtualHost” blocks ?

    This is where the domain name gets translated to a file directory.

    Thread Starter fendervr

    (@fendervr)

    Hi Ross,
    here below my httpd.conf file and httpd-vhosts.conf. I attached the real files.
    Please notice that when I previously wrote mysite.dev, really I conducted my trials on parrocchiatombaextra.dev. I thought that in that way the discussion was easier, but what has been said does not change.
    Sorry for any inconvenience.

    The relevant lines in my opinion, are:

    # Virtual hosts
    Include conf/extra/httpd-vhosts.conf

    in the first file and in the second: .

    <VirtualHost *:80>
    DocumentRoot “c:/wamp/www/parrocchiatombaextra.dev”
    ServerName parrocchiatombaextra.dev
    <Directory “c:/wamp/www/parrocchiatombaextra.dev”>
    AllowOverride All
    Require local
    </Directory>
    </VirtualHost>

    Many thanks.

    whole httpd.conf is here: https://pastebin.com/GKqJ1JML

    whole httpd-vhosts.conf below:

    # Virtual Hosts
    #
    # Required modules: mod_log_config
    
    # If you want to maintain multiple domains/hostnames on your
    # machine you can setup VirtualHost containers for them. Most configurations
    # use only name-based virtual hosts so the server doesn't need to worry about
    # IP addresses. This is indicated by the asterisks in the directives below.
    #
    # Please see the documentation at 
    # <URL:http://httpd.apache.org/docs/2.4/vhosts/>
    # for further details before you try to setup virtual hosts.
    #
    # You may use the command line option '-S' to verify your virtual host
    # configuration.
    
     <VirtualHost *:80>
    	 ServerAdmin admin@localhost
         DocumentRoot "c:/wamp/www"
         ServerName localhost
         ServerAlias www.localhost.com
    	 ErrorLog "logs/localhost-error.log"
         CustomLog "logs/localhost-access.log" common
    
         <Directory  "c:/wamp/www">
            AllowOverride All
     		Require local
         </Directory>
    	 
     </VirtualHost>
     
     
    <VirtualHost *:80>
         DocumentRoot "c:/wamp/www/parrocchiatombaextra.dev"
         ServerName parrocchiatombaextra.dev
         <Directory  "c:/wamp/www/parrocchiatombaextra.dev">
            AllowOverride All
     		Require local
         </Directory>
     </VirtualHost>
    
     <VirtualHost *:80>
         DocumentRoot "c:/wamp/www/presepiverona.h5.dev"
         ServerName presepiverona.dev
         <Directory  "c:/wamp/www/presepiverona.h5.dev">
            AllowOverride All
     		Require local
         </Directory>
     </VirtualHost>
    
    <VirtualHost *:80>
         DocumentRoot "c:/wamp/www/classi_risorse"
         ServerName risorse.dev
         <Directory  "c:/wamp/www/classi_risorse">
            AllowOverride All
     		Require local
         </Directory>
     </VirtualHost>
    
      <VirtualHost *:80>
         DocumentRoot "c:/wamp/www/cplweb.dev"
         ServerName cplweb.dev
         <Directory  "c:/wamp/www/cplweb.dev">
            AllowOverride All
     		Require local
         </Directory>
     </VirtualHost>
    • This reply was modified 6 years, 9 months ago by Jan Dembowski.
    • This reply was modified 6 years, 9 months ago by Jan Dembowski. Reason: Removed 640 lines of config
    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Please don’t post that much here. It breaks after 10 lines or so.

    If you want to share that config, use https://pastebin.com/ instead and share the link to that here.

    Thread Starter fendervr

    (@fendervr)

    @jdembowski
    Thanks Jan, I amended the previous post.

    Claudio

    I have read through these files and everything look correct.
    The only change you need is to enable “mod_rewrite:
    #LoadModule rewrite_module modules/mod_rewrite.so

    From “httpd-vhosts.conf” I see

    # Please see the documentation at 
    # <URL:http://httpd.apache.org/docs/2.4/vhosts/>
    # for further details before you try to setup virtual hosts.
    #
    # You may use the command line option '-S' to verify your 
    virtual host
    # configuration.

    The details around using “-S” are:

    Windows example
    
    httpd.exe -S
    
    This command will dump out a description of how Apache 
    parsed the configuration file. 
    Careful examination of the IP addresses and server names 
    may help uncover configuration mistakes. 
    (See the docs for the httpd program for other command 
    line options)

    In addition please check all of the error log files, the locations are listed in the files.

    • This reply was modified 6 years, 9 months ago by RossMitchell.
    • This reply was modified 6 years, 9 months ago by RossMitchell.
    Thread Starter fendervr

    (@fendervr)

    Hi Ross, I’m here again.
    I made some trials more in these past days.

    This is the output of the httpd.exe -S as you suggested

    Microsoft Windows [Versione 10.0.16299.309]
    (c) 2017 Microsoft Corporation. Tutti i diritti sono riservati.
    
    C:\Users\Claudio>C:\wamp\bin\apache\apache2.4.9\bin\httpd.exe -S
    VirtualHost configuration:
    *:80                   is a NameVirtualHost
             default server localhost (C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf:17)
             port 80 namevhost localhost (C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf:17)
                     alias www.localhost.com
             port 80 namevhost parrocchiatombaextra.dev (C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf:33)
             port 80 namevhost presepiverona.dev (C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf:42)
             port 80 namevhost risorse.dev (C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf:51)
             port 80 namevhost cplweb.dev (C:/wamp/bin/apache/apache2.4.9/conf/extra/httpd-vhosts.conf:60)
    ServerRoot: "C:/wamp/bin/apache/apache2.4.9"
    Main DocumentRoot: "C:/wamp/www/"
    Main ErrorLog: "C:/wamp/logs/apache_error.log"
    Mutex default: dir="C:/wamp/bin/apache/apache2.4.9/logs/" mechanism=default
    PidFile: "C:/wamp/bin/apache/apache2.4.9/logs/httpd.pid"
    Define: DUMP_VHOSTS
    Define: DUMP_RUN_CFG
    Define: APACHE24=Apache2.4

    I don’t see anything that help me in understanding, maybe for my lack of knowledge.
    I had no help neither from the logs analysis.

    Anyway I tried to type “mysyte.dev” and “localhost/mysite.dev” in three different browser. Results below.
    * Microsoft Edge: in both case, no change within the address bar and my homepage is correctly loaded.
    * Firefox: Typing “mysyte.dev” Firefox adds https:// before URL and doesn’t connect to the server, giving me an error. – Typing “localhost/mysite.dev” no change within the address bar and my homepage is correctly loaded.
    * Chrome: Typing “mysyte.dev” Chrome adds https:// before URL and doesn’t connect to the server, giving error. – Typing “localhost/mysite.dev” no change within the address bar and my homepage is correctly loaded.

    I think so far that the problem is in the WAMP server configuration or in the browser behaviour. I will look for a more information on URL and localhost as there is no implication of WordPress.

    Many thanks for your help and patience.
    Claudio

    I agree that it is not specifically a WordPress problem. In particular the failure of:
    http://mysite.dev/wordpress/readme.html
    and success of:
    http://localhost/mysite.dev/wordpress/readme.html

    When you fix this you will be a very long way towards fixing everything.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Virtualhosts address after wordpress installation’ is closed to new replies.