Configure Orangescrum Community Edition on NGINX Web Server 1. Update the system with the following command. # yum update –y 2. Install LEMP 2.1. For installing nginx, trigger the below command. # rpm -‐Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-‐release-‐6-‐8.noarch.rpm # yum update # yum install nginx Nginx is now installed on the system and now we will start the service. # /etc/init.d/nginx start # chkconfig nginx on 2.2. Now we install the MySQL database and then start and configure the MySQL database. # yum install mysql mysql-‐server # chkconfig mysqld on # /etc/init.d/mysqld start # mysql_secure_installation After press output will be like this. System will ask you some question and you have to answer them accordingly, as shown below. NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MySQL to secure it, we'll need the current password for the root user. If you've just installed MySQL, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MySQL root user without the proper authorisation. Set root password? [Y/n] <-‐-‐ ENTER
Configure Orangescrum Community Edition on NGINX Web Server New password: <-‐-‐ yourrootsqlpassword Re-‐enter new password: <-‐-‐ yourrootsqlpassword Password updated successfully! Reloading privilege tables.. ... Success! By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] <-‐-‐ ENTER ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] <-‐-‐ ENTER ... Success! By default, MySQL comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] <-‐-‐ ENTER -‐ Dropping test database... ... Success! -‐ Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] <-‐-‐ ENTER ... Success! Cleaning up... All done! If you've completed all of the above steps, your MySQL installation should now be secure.
Configure Orangescrum Community Edition on NGINX Web Server Thanks for using MySQL! 2.3. Then we will install php, php-‐fpm and php-‐common and then start the php-‐fpm service. # yum install php php-‐common php-‐fpm # chkconfig php-‐fpm start # chkconfig -‐-‐list # /etc/init.d/php-‐fpm start 2.4. Then we will install some php-‐modules. # yum install php-‐mysql php-‐pgsql php-‐pecl-‐mongo php-‐sqlite php-‐pecl-‐memcache php-‐ pecl-‐memcached php-‐gd php-‐mbstring php-‐mcrypt php-‐xml php-‐pecl-‐apc php-‐cli php-‐pear php-‐pdo With this Nginx, MySQL and php installed on the system. To configure the orangescrum community edition, first we download the source code from http://www.orangescrum.org/download. After downloading first we have to create a database user, database with mysql command. 3. MySQL configuration. 3.1. Login as root user. # mysql -‐u root –p Enter password: It will ask for password. With the right credential you will get a prompt like below. mysql> 3.2. Create the database. Here my database name is orangescrum. mysql> create database orangescrum; To verify it, mysql> show databases; you will get database list.
Configure Orangescrum Community Edition on NGINX Web Server 3.3. Create the user and give it the password with all privileges. Here my database user is orangescrum and password is orangescrum too. mysql> create user orangescrum; mysql> grant all on orangescrum.* to 'orangescrum'@'localhost' identified by 'orangescrum'; 3.4. Exit from the database, Restore the database from database.sql file which was downloaded along with the orangescrum community edition. Here my database is on /root directory. # mysql -‐u orangescrum -‐p orangescrum < /root/database.sql Enter password: By this database has been configured. Now we are going to configure the virtual hosting on nginx server to run the orangescrum community edition. 4. Configure virtual hosting on nginx. 4.1. Open the php.ini file and make a small change. # vi /etc/php.ini Search the line cgi.fix_pathinfo=1, uncomment this and change the value 1 to 0. cgi.fix_pathinfo=0 4.2. Open the php.fpm configuration file and replace the apache in the user and group with nginx. Then after restart the php-‐fpm service. # vi /etc/php-‐fpm.d/www.conf [...] ; Unix user/group of processes ; Note: The user is mandatory. If the group is not set, the default user's group ; will be used. ; RPM: apache Choosed to be able to access some dir as httpd user = nginx ; RPM: Keep a group allowed to write in log dir. group = nginx [...] # chkconfig php-‐fpm on # /etc/init.d/php-‐fpm start.
Configure Orangescrum Community Edition on NGINX Web Server 4.3. Open the default nginx config file and do below changes . # vi /etc/nginx/conf.d/default.conf # # The default server # server { listen 80 default_server; # server_name orscommunity.com; #charset koi8-‐r; #access_log logs/host.access.log main; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; location / { root /usr/share/nginx/html/; index index.html index.htm; } error_page 404 /404.html; location = /404.html { root /usr/share/nginx/html/; } # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html/; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 #
Configure Orangescrum Community Edition on NGINX Web Server location ~ \.php$ { root /usr/share/nginx/html/; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} 4.4. Create a directory under /var/www/html/ folder called public_html. # mkdir /var/www/html/public_html 4.5. Copy the downloaded folder to the public_html directory and give the permission to /var/www and change ownerschip of OS_Community directory accordingly. Here my downloaded directory is OS_Community. #Cp –r –a –p /root/OS_Community /var/www/html/public_html/ # chmod 755 /var/www # chown –R nginx:nginx /var/www/html/public_html 4.6. Edit the /etc/nginx/conf.d/virtual.conf as below. Here my virtual host is orscommunity.com/www.orscommunity.com # vi /etc/nginx/conf.d/virtual.conf server { listen 80; server_name orscommunity.com www.orscommunity.com; access_log /var/log/nginx/orscommunity.com.access.log; error_log /var/log/nginx/orscommunity.com.error.log; root /var/www/html/public_html/OS_Community/orangescrum-‐master; index index.php; # use fastcgi for all php files
Configure Orangescrum Community Edition on NGINX Web Server # Are you sure you have this set up? location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location / { try_files $uri $uri/ /index.php?$uri&$args; rewrite ^/$ /app/webroot/ break; rewrite ^(.*)$ /app/webroot/$1 break; } # deny access to apache .htaccess files location ~ /\.ht { deny all; } } 4.7. Rename the .htaccess file to .htaccess_bak. # cd /var/www/html/public_html/OS_Community/orangescrum-‐master/ # mv .htaccess .htaccess_bak. Now open your browser and type your url.