Support » Networking WordPress » What did I do wrong in this subdomain install on WAMP?

  • I read:

    http://wordpress.org/support/topic/how-to-install-multisite-at-home?replies=7

    and

    http://www.scriptol.com/wordpress/installing-wordpress-locally.php

    and got going.

    1. I installed wordpress locally by following those steps. Simply created a database in myphpadmin called ‘wordpress’. Filled wpconfig:

    <?php
    // ** MySQL settings ** //
    define('DB_NAME', 'wordpress');
    define('DB_USER', 'root');
    define('DB_PASSWORD', '');
    define('DB_HOST', 'localhost');
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    Working fine.

    2. Then I installed WordPress, and followed the guide in the first link:

    Filled wp-config with:

    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', true );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'localhost' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );

    And created an .hcaccess file in the wordpress folder with:

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    3. But then I get the following message on localhost (or the subfolder I installed this wordpress on, as I’ve tried various variations):

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    4. Totally clueless as to what I’m doing wrong. I’ve filled the host file in the windows drivers section with all sorts of stuff like:

    127.0.0.1 localhost
    127.0.0.1 test2.localhost

    so I’m at a total loss. Plz help?

Viewing 10 replies - 1 through 10 (of 10 total)
  • I’ve also tried without the regexp:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule . index.php [L]
    # END WordPress

    as .htaccess.

    And I’ve tried understanding ‘Path to current site’ as the directory it’s in in my Windows Vista, but that doesn’t cut it either.

    I’ve tried the subdirectory example in

    http://codex.wordpress.org/Create_A_Network

    and writtern this into the htaccess:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    # END WordPress

    Just in case it works that way on localhost, but no luck. And when I write the order into the wpconfig, but leave out the htaccess, I’m told the page isn’t redirecting properly.

    Can an admin plz transfer this question to Multisite section?

    Is there anything specific I have to do ‘to my Apache’ apart from these mod rewrites and htaccess?

    Check the requirements here

    http://codex.wordpress.org/Create_A_Network

    Clearly a much clearer guide to isntalling subdomains on WAMP is required.

    That guide says subdomains won’t work if the localhost is the same as 127.0.0.1, but that doesn’t make sense because whatever the name of the fake domain is you have to rewrite it in the windows host file to redirect to 127.0.0.1

    And as I addressed in a more recent post at the multisite forum, even when I point localhost.localdomain to my phpmyadmin, my wordpress installation won’t budge and will remain as localhost.

    And if it’s true subdomains only work in the root folder, then what to do with the default index file that comes with the phpmyadmin…

    Way too many things can be going wrong with subdomains on localhost for there not to be a step by step guide out there on the entire internet.

    It’s kinda pitiful, but I guess it’s to be expected from free software. There’s no incentive to improve it. I admit I’m not the brightest in the bunch, but this is ridiculous how difficult it is to install subdomains on localhost, if at all possible.

    @jirimenzel , did you manage to install multisite locally in the end?
    I’m having trouble installing it too and trouble in finding a good guide on how to. plenty tutorials and articles are available for a single wordpress site, but multisite is hard to find.
    I have WAMP running on my laptop and have two single sites in the www root in separate directories and they both work like a dream. I tried installing a multisite in third separate directory but it just keeps pointing to the live site. (yes, have changed htacces, hosts and blog id plus home in the database to point to local site)

    If it HAS to be installed in the root www, how will my current single sites still work?

    btw my multisite is already live ( http://www.driverszone.co.uk ), but I want to re-create it locally for testing, and have also posted on the wamp server forum who had an extensive look at my install via teamviewer yesterday and also could not quite figure out the problem either..

    So I’d be insterested to know @jirimenzel if you managed it, or anyone else who has?

    but I guess it’s to be expected from free software. There’s no incentive to improve it. I admit I’m not the brightest in the bunch, but this is ridiculous how difficult it is to install subdomains on localhost, if at all possible.

    wildcard subdomains on localhost are not done within wordpress. So in the constant updates that WEP undergoes on a daily basis (see trac) there isn’t anything that even could be done.

    While WP taps into them, it does not set them up server side (it can’t).

    Set up a few specific subdomains in your local hosts file.

    @andrea_r oh yes, you are correct, I completely read over the fact that @jirimenzel has sub domains, I was blinded by the fact he was trying to install a WPMU on WAMP, which is what I am trying too. My situation is slightly different though, as my current install is not sub domains but sub directories, so it should work on localhost right?
    Currently it gets redirected to the live site despite editing hotst, .htaccess and site url & home in wp-options table in the database…
    Any ideas what I’ve forgotten or done wrong? Know of a good on line guide/tutorial that explains all the steps to get WPMU working on WAMP?

    So I have worked it out, rather, stevenmartin99 at wampservers did 🙂

    He had a look with teamviewer on my computer and set up and made it work!
    background information, WAMP server up and running with two single wordpress site each in their own folder in C:/wamp/www

    Essentially, I followed these steps to get my first website (blog) working:
    • turn off skype (as it uses post 80),
    • install wamp, not changing default settings,
    • launch wamp. (you can turn skype back on now, it will automatically use a different port as WAMP is occupying port 80 now)
    • click wamp in taskbar, go to php and click php.ini.
    • change upload_max_filesize and post_max_size to 1000, save file and restart computer.
    • copy back up of public_html in the www folder (in my case it was C:/wamp/www/blog)
    • create database in localhost/phpmyadmin with the same name as database in public wordpress site (found in wp-config.php).
    • select database, import the back up .sql file.
    • in wp_options table find siteurl (page1) and home (page 2) change url to [localhost] and click go.
    • create new user with same name and password as wp-config.php & ADD user to correct database after creation.
    • switch on apache rewrite_module (right click wamp and go to apache/modules, scroll down untill you find rewrite_module) and restart, delete .htaccess and go to your localhost/blog/wp-admin WordPress dashboard. change permalink settings to default and change back to what you had (to create new .htaccess file, because just enabling rewrite did not create a new .htaccess for me, this did ).
    • Done.

    To the the wordpres MU to work, I changed this steps in addition to the above (bearing in mind the site I FTP-ed in is already a live multi site – if your is not follow the wordpress codex: how to set up a network to make your wordpress a multisite):

    in wp-config file:
    —————

    define(‘WP_HOME’, ‘http://yourlocalsitename.loc’ );
    define(‘WP_SITEURL’, ‘http://yourlocalsitename.loc’);

    define( ‘DOMAIN_CURRENT_SITE’, ‘yourlocalsitename.loc’ );

    ———————————————–
    ———————————————–

    database settings:
    —————

    table = wp_options:
    —————-
    option_id 1 siteurl to yourlocalsitename.loc
    option_is 37 home to yourlocalsitename.loc

    table = wp_blog:
    —————-
    column – domain = change all urls to yourlocalsitename.loc

    table= wp_site:
    —————-
    change url to yourlocalsitename.loc

    ————————————-
    ————————————–

    C:\wamp\bin\apache\Apache2.2.17\conf\extra\httpd-vhosts.conf:
    —————————————————————

    ## TO ADD A NEW SITE COPY A <VHOST> SECTION BELOW AND CHANGE THE URLS AND PATH TO POINT
    ## TO THE SITE. MAKE SURE YOU ALSO CREATE THE LOGS FOLDER AS APACHE DOES NOT DO THIS.
    ## THEN OPEN C:\windows\system32\drivers\etc\hosts and add an entry
    ## 127.0.0.1 yourlocalsitename.loc
    ## SAVE AND RESTART WAMP FOR THE NEW URL TO WORK.

    <VirtualHost *:80>
    ServerName yourlocalsitename.loc
    ServerAlias yourlocalsitename.loc
    DocumentRoot “C:/wamp/www/yourlocalsitename”
    </VirtualHost>

    <VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot “c:/wamp/www”
    ServerName localhost
    ErrorLog “logs/localhost-error.log”
    CustomLog “logs/localhost-access.log” common
    </VirtualHost>

    to browse to your localhost wordpress MU site, just type in: yourlocalsitename.loc

    🙂 Hope this will help others set up WordPress MU on a localhost

    It’s not called wordpress MU anymore. it’s multisite.

    Here is a really good tutorial that shows you step-by-step how to set up a sub domain; http://www.itutorblog.com/2011/06/how-to-create-a-subdomain-on-wamp/

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘What did I do wrong in this subdomain install on WAMP?’ is closed to new replies.