# Blog installation on stage machine

**URL:** <https://www.ruby-forum.com/t/blog-installation-on-stage-machine/163975>\
**Category:** Deployment\
**Created:** [March 26, 2009, 4:44pm UTC](https://www.ruby-forum.com/t/blog-installation-on-stage-machine/163975 "2009-03-26T16:44:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![palani](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ed655f/32.png) [@palani](https://www.ruby-forum.com/u/palani)\
**Post date:** [March 26, 2009, 4:44pm UTC](https://www.ruby-forum.com/t/blog-installation-on-stage-machine/163975/1 "2009-03-26T16:44:07Z")

</div>

Hi,  
Can anyone please solve the problem . I successfully installed the  
wordpress blong into my Rails apps locally. my local machine is Ubuntu.  
Now i just want push this updation into my staging machine(which is a  
slice host).

for this i configure the apache server :  
step 1: i create new file. The file content is

```
            <VirtualHost *>
                 <Proxy balancer://myapp_cluster>
                         BalancerMember http://127.0.0.1:3000
                          BalancerMember http://127.0.0.1:3001
                  </Proxy>
             ServerName staging.myapp.com
    DocumentRoot /u/apps/myapp/current/public/
           <Directory />
                   Options FollowSymLinks
                   AllowOverride None
            </Directory>
        <Directory /u/apps/myapp/current/public/>
                   Options Indexes FollowSymLinks MultiViews
                   AllowOverride None
                   Order allow,deny
                   allow from all
         # This directive allows us to have apache2's default start

```

page  
# in /apache2-default/, but still have / go to the right  
place  
#RedirectMatch ^/$ /apache2-default/

```
            AuthType Basic
            AuthName "Staging"
            AuthBasicProvider file
            AuthUserFile /etc/apache2/passwords
            Require user myuser
    </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.staging.log

    # Possible values include: debug, info, notice, warn, error,

```

crit,  
# alert, emerg.  
LogLevel warn

```
    CustomLog /var/log/apache2/access.staging.log combined
    ServerSignature On

    RewriteEngine On

    RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
    RewriteCond %{SCRIPT_FILENAME} !maintenance.html
    RewriteRule ^.*$ /system/maintenance.html [L]

    RewriteRule ^/$ /index.html [QSA]
    # Rewrite to check for Rails cached page
    RewriteRule ^([^.]+)$ $1.html [QSA]

    RewriteRule ^/blog/?(.*)$ %{DOCUMENT_ROOT}/blog/$1 [NC,QSA,L]

    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$ balancer://myapp_cluster%{REQUEST_URI}

```

[P,QSA,L]

Step 2:  
I saved the file with the name [staging.myapp.com](http://staging.myapp.com) into  
/etc/apache2/sites-available/staging.myapp.com

Step 3: I enable the file by using the command sudo a2siteen  
[staging.myapp.com](http://staging.myapp.com). It successfully enabled.

step 4: I restart the apache2 service by using /etc/init.d/apache2  
restart.  
It successfully restarted.

```
   This is what i locally did. i successfully got working.but

```

The problem is when i type the url : [http://staging.myapp.com/blog](http://staging.myapp.com/blog) It  
doesn’t open the blog installation. It shows only the ruby unknow  
action error.

My Stage machine(Ubuntu) was a slice host with phusion-passenger.In my  
stage apache configuration their is a file under  
/etc/apache2/site-available/001-staging.

file content is :

\<VirtualHost \*\>  
ServerAdmin removed\_email\_address@domain.invalid  
ServerName [staging.myapp.com](http://staging.myapp.com)

```
    DocumentRoot /u/apps/myapp/current/public/

    RailsEnv staging
    ErrorLog /var/log/apache2/error.staging.log

    # Possible values include: debug, info, notice, warn, error,

```

crit,  
# alert, emerg.  
LogLevel warn

```
    CustomLog /var/log/apache2/access.staging.log combined

```

When i disable this file . i couldn’t see my stage site.I wrote the  
Rewrite rules with in this file also but no luck.

What i miss here. IS that anything i need to specify passenger about the  
Rewrite rule. If yes where should I? can any one please help out. It is  
complete mess for me
