The MU forums have moved to WordPress.org

VHOST Problem - Ubuntu Local Install (22 posts)

  1. FGazerro
    Member
    Posted 14 years ago #

    Hello,

    I have WordPress installed locally and want to install WordPress MU in another directory. Whenever I go to "localhost/wpmu/index.php" in my browser to run the install I get the following error:

    Warning: constant() [function.constant]: Couldn't find constant VHOST in /var/www/wpmu/wp-settings.php on line 100

    Warning: constant() [function.constant]: Couldn't find constant VHOST in /var/www/wpmu/wpmu-settings.php on line 33
    No WPMU site defined on this host. If you are the owner of this site, please check Debugging WPMU for further assistance.

    I realize this error has been reported a million times but I'm having a lot of trouble making sense of everything.

    OS: Ubuntu Hardy Heron
    Regular WordPress Directory: /var/www/
    WordPress MU: /var/www/wpmu

    I followed the instructions in the readme and did to following:

    1. Created a new database called wordpressmu and a user by the same name with rights to the database.

    2. to "/etc/apache2/apache2.conf" I added:
    LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

    3. to "/etc/apache2/apache2.conf" I changed "AllowOverride None" to "AllowOverride FileInfo Options"

    4. The next step I did not do because I could not find the <VirtualHost> section in Apache2.conf. I'm sure that the problem has something to do with this but I'm at a total loss as to what to do.

    Any help would be tremendously appreciated. Thank you.

    Frank

  2. MrBrian
    Member
    Posted 14 years ago #

    You're missing the config file created during the install process. Do a search on the error around the forum, there's tons of topics on it.

  3. tdjcbe
    Member
    Posted 14 years ago #

    You're also using localhost as a domain. You need to use a correctly formed domain for the install. ie: localhost.tld

  4. FGazerro
    Member
    Posted 14 years ago #

    MrBrian, tdjcbe,

    Thank you for your help. I realize questions from somebody who doesn't know what they are talking about can be frustrating. I appreciate your patience. I forgot to mention: I'm running Ubuntu Hardy Heron Desktop Edition (not server).

    1. I've looked around the forums for help with the config file. I'm having trouble making sense of it. I think the config file is missing because no installation process took place at all, I just go the above errors.

    2. I'm unsure how localhost.tld works. tdjcbe, when you say "Use a correctly formed domain for the install. ie: localhost.tld" are you referring to the url I type in to get to the WPMU install screen? Or are you referring to something I would fill in AT the WP install screen (which I can't get to)?

    3. The ReadMe says to set up the <VirtualHost> stuff and the DNS setup for subdomains before running the installation. I have not done these steps because I really don't understand what I'm supposed to do.

    4. I would like to run the multiple blogs with subdomains as opposed to subdirectories, though, I'm not sure if thats possible given the fact that WPMU is currently in a subdirectory of my /var/www/ folder. Not sure if I'm missing anything required to do this.

  5. andrea_r
    Moderator
    Posted 14 years ago #

    You have to set up your box so localhost is localhost.tld (or whatever, as long as there's an extension). Set it up to show /var/www/wpmu as its own local domain.

    the vhost stuff *has* to be done if you want subdomains.

    But, ike you said, gotta get to the install screen first. ;)

  6. FGazerro
    Member
    Posted 14 years ago #

    andrea_r,

    Thanks for responding.

    -How do I set up my box so localhost is localhost.tld? Do I need the install screen do to that?

    -Is the process of setting up localhost.tld any different since i'm attmeping to install WPMU alongside regulard WP in a sub directory?
    Wordpress is installed in "/var/www/"
    WPMU is currently in: "/var/www/wpmu/"

    Thanks for your help.

    Frank

  7. lunabyte
    Member
    Posted 14 years ago #

    Andrea wasn't exactly correct.

    You need to set up your apache vhost to answer for "domain.tld", then modify /etc/hosts to add the following: 127.0.0.1 domain.tld

    Now, "domain.tld" could be whatever you want it to be. It could be test.loc, site.home, etc. The main point is that there is a name and extension format. Since it's all local, for testing I'm assuming, it doesn't matter what it is.

    If you're playing with subdomains, you'll have to add them to /etc/hosts as well. So your line might look like:

    127.0.0.1 domain.tld text.domain.tld test2.domain.tld

    Under live server circumstances, you wouldn't be editing your hosts file since there would be live DNS covering it.

  8. lunabyte
    Member
    Posted 14 years ago #

    Oh, and make sure the vhost (in apache) for MU is set with a path to the wpmu directory.

  9. FGazerro
    Member
    Posted 14 years ago #

    lunabyte,

    Thanks for the help. So let me make sure I get what your saying. I need to do the following:

    1. Set apache to answer to domain.tld. To do this would I edit the apache2.conf file and add in:
    <VirtualHost *>
    ServerName domain.tld
    DocumentRoot /var/www/wpmu
    </VirtualHost>
    NOTE: I do not see any <virtualhost> area in the apache2.conf at the moment.

    2. Then add "127.0.0.1 domain.tld" to /etc/hosts

    3. QUESTION: For using subdomains, where does adding a "*" hostname record that points to the webserver come in?

    4. QUESTION: Instruction #3 in the ReadMe says to add: "ServerAlias *.domain.tld" to the config file to make it work with subdomains. Is this config file created after the installation is run?

    Thanks!

  10. siteblob
    Member
    Posted 14 years ago #

    Dear FGazerro,

    I'm having the same problem exactly like yours.. Have you found the solution..?

  11. andrea_r
    Moderator
    Posted 14 years ago #

    Look in the httpd.conf file guys, you need to add that stuff in there.

  12. siteblob
    Member
    Posted 14 years ago #

    sorry, i wish to ask a novice question as i not really know much about server setting.

    if i'm using a shared hosting service, when i add a subdomain for wpmu.domain.com, will the setting added to httpd.conf automatically?

    or i need to ask my service provider to do that for me?

  13. andrea_r
    Moderator
    Posted 14 years ago #

    Send the readme file to your webhost.

  14. FGazerro
    Member
    Posted 14 years ago #

    Andrea_r,

    Thanks for your patience.

    So,

    1. All the <virtualhost> stuff goes in httpd.conf? My httpd.conf is empty and seems to use Apache2.conf isntead. Does it matter which I use?

    2. Then I update etc/hosts like we discussed earlier?

    3. Where exactly does adding a " * " to the hostname record for subdomains come in?

    4. lunabyte said "...make sure the vhost (in apache) for MU is set with a path to the wpmu directory." Is the "vhost" lunabyte referred to the <virtualhost> section of httpd.conf/apache2.conf?

    I apologize for all the questions. I'm very new to working with servers. Ya'll have the patience of saints. Thank you!

    Frank

  15. siteblob
    Member
    Posted 14 years ago #

    my webhost is not helpful...

    can i ensure something... is this application not supported for share hosting?

  16. andrea_r
    Moderator
    Posted 14 years ago #

    @siteblob Nope, not really.

  17. siteblob
    Member
    Posted 14 years ago #

    well, i think i should change to a better hosting company instead..

    Thanks for your help andrea_r...

  18. FGazerro
    Member
    Posted 14 years ago #

    Hey guys,

    It still won't work. I'm running Ubuntu Desktop with Apache2. I keep getting the same errors:

    Warning: constant() [function.constant]: Couldn't find constant VHOST in /var/www/wpmu/wp-settings.php on line 100
    Warning: constant() [function.constant]: Couldn't find constant VHOST in /var/www/wpmu/wpmu-settings.php on line 33
    No WPMU site defined on this host. If you are the owner of this site, please check Debugging WPMU for further assistance.

    I have done the following:

    1. Added the following to "/etc/apache2/apache.conf"
    "LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so"
    And added "AllowOverride FileInfo Options" to the <Director> section.

    2. Created a new file in "etc/apache2/sites-available" called "wpmu.loc". In that file, I copy and pasted the contents of the default file in the sites-available directory and modified it accordingly. (I'll copy and paste the contents at the bottom of this message.

    3. I added wpmu.loc to "/etc/hosts". The line looks like this:
    127.0.0.1 localhost wpmu.loc

    4. Restarted Apache.

    Still won't work.

    Please help me.

    Frank

    Contents of the "sites-available" file i made:

    #NameVirtualHost 127.0.0.1:80
    <VirtualHost 127.0.0.1:80>
    ServerAdmin FGazerro@localhost
    ServerName wpmu.loc
    ServerAlias *.wpmu.loc
    DocumentRoot /var/www/wpmu
    <Directory />
    Options FollowSymLinks
    AllowOverride FileInfo Options
    </Directory>
    <Directory /var/www/wpmu>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride FileInfo Options
    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
    ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride FileInfo Options
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

    </VirtualHost>

  19. mellow_bunny
    Member
    Posted 13 years ago #

    I know i'm stupidly late to this topic but with Ubuntu all you need to do to access a locally installed WPMU is to find out your pc's hostname. This is as simple as opening a terminal and typing "hostname". It will then tell you your hostname.

    michael@michael-nouto:~$ hostname
    michael-nouto

    All I had to do after that is type http://michael-nouto/ and it took me straight to my local site.

  20. tdjcbe
    Member
    Posted 13 years ago #

    That'll bring you to your site but that will still cause issues with wpmu. The software needs a two tld domain to work with.

  21. mellow_bunny
    Member
    Posted 13 years ago #

    Oh right i'll file that away. Thanks tdjcbe.

  22. tdjcbe
    Member
    Posted 13 years ago #

    Not a problem.

    As an aside, is this setup check no longer working? We've had threads recently on this and the use of IP addreses.

    I'm just concerned.

About this Topic