LoginSignup
1
1

More than 5 years have passed since last update.

openXをcentOSで動かす

Last updated at Posted at 2013-10-02

必要なソフトウェアをインストール

yumで必要なソフトをインストールする。
nginxはyumでインストールする

sudo yum install mysql-server php php-mysql php-fpm php-gd
sudo rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
sudo yum list nginx
sudo yum install -y nginx

openXをインストール

下記のページからopenXをダウンロードする。
http://www.openx.com/products/source-download

ダウンロードしたファイルを展開し配置する。

tar xf openx-2.8.11.tar.bz2
sudo mv openx-2.8.11 /var/lib/openx-2.8.11
cd /var/lib
sudo ln -s openx-2.8.11 /var/lib/openx
sudo chmod -R a+w /var/lib/openx-2.8.11/var
sudo chmod -R a+w /var/lib/openx-2.8.11/var/cache
sudo chmod -R a+w /var/lib/openx-2.8.11/var/plugins
sudo chmod -R a+w /var/lib/openx-2.8.11/var/templates_compiled
sudo chmod -R a+w /var/lib/openx-2.8.11/plugins
sudo chmod -R a+w /var/lib/openx-2.8.11/www/admin/plugins
sudo chmod -R a+w /var/lib/openx-2.8.11/www/images

nginxの設定

sudo vi /etc/nginx/nginx.conf
nginx.conf
    server {
        listen       80 default;

        location / {
            root   /var/lib/openx;
            index  index.html index.htm index.php;
        }

        location ~ \.php$ {
            root           html;
            fastcgi_pass   192.168.33.10:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/lib/openx$fastcgi_script_name;
            include        fastcgi_params;
        }
    }

起動・確認

PHPとMYSQLとnginxを起動する。

sudo service php-fpm start
sudo service mysqld start
sudo service nginx start

ブラウザでサーバーにアクセスしてopenXの画面が表示されれば完了。
http://XXX.XXX.XXX.XXX

おまけ

ブラウザでアクセスして表示されなかったとき。
ファイアウォールが原因なら外す。

sudo /etc/rc.d/init.d/iptables stop
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1