Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App: Wordpress #27

Open
rxaviers opened this issue Aug 21, 2014 · 1 comment
Open

App: Wordpress #27

rxaviers opened this issue Aug 21, 2014 · 1 comment

Comments

@rxaviers
Copy link
Collaborator

Depends on Php Fastcgi, Mysql, Nginx and Deploy.

File structure

Create the following dirs:

mkdir -p /var/log/nginx/foo.bar

Place project files

su - deploy
git clone /srv/git/foo.git tmp

wget http://wordpress.org/wordpress-3.3.2.tar.gz
tar -xzf wordpress-3.3.2.tar.gz
rm wordpress-3.3.2.tar.gz
mv wordpress foo.bar

# create mysql db and user (see below), then:
gunzip < tmp/live.sql.gz | mysql -u foorw foodb --password=foopasswd
rm tmp/live.sql.gz

mv tmp/* foo/

Mysql

database: foodb
user: foorw
passwd: foopasswd

CREATE USER 'foorw'@'localhost' IDENTIFIED BY 'foopasswd';
CREATE DATABASE foodb;
GRANT ALL ON foodb.* TO 'foorw'@'localhost';

Nginx

Create /etc/nginx/sites-available/foo with:

server {
    listen   80;
    server_name foo.bar;
    access_log /var/log/nginx/foo.bar/access.log;
    error_log /var/log/nginx/foo.bar/error.log;
    root /srv/foo;

    index index.php;

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location / {
        try_files $uri $uri/ /index.php;
    }

    location ~ \.php$ {
        try_files $uri =404;
        include fastcgi_params;
        fastcgi_param HTTPS $fastcgi_https;
        fastcgi_intercept_errors on;
        fastcgi_pass 127.0.0.1:9000;
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
        expires max;
        log_not_found off;
    }
}

Create the following link

ln -s /etc/nginx/sites-available/foo.bar /etc/nginx/sites-enabled/foo.bar

Restart nginx

service nginx restart
@rxaviers
Copy link
Collaborator Author

Ideally, though, I would like to do the below OR something better.

It would lead me to:

su - deploy
git clone /srv/git/foo.git
cd foo

wget http://wordpress.org/wordpress-3.3.2.tar.gz
tar -xzf wordpress-3.3.2.tar.gz
rm wordpress-3.3.2.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant