Installation Guide for UberX
Prerequisites
Amazon Web Services
Web browser
Terminal Emulator
Step by step procedure for installation
Step 1 : Open AWS at the browser.Sign into it by entering valid credentials.
Step 2: On signing in you will be directed to a page as shown in below screenshot. In
the obtained page click on EC2 (Virtual Servers in the Cloud).
Step 3 : In a page obtained click on Launch Instance.
Step 4: From the list of server, select Ubuntu Server 14.04 .
Step 5 : Enable the t2 small bullet.
Step 6 : On enabling, click on Add Storage,
Step 7 : In Add Storage page , set the size to 30GB and click on Review and Launch.
Step 8: A new page for Review Instance Launch will be opened. Click on Launch.
Step 9 : On clicking Launch, new pop up window will appear. Set the type of key to
Create a new key pair and by entering the Key pair name click on Download Key
Pair.
Step 10 : Open terminal window and type the below mentioned command to change
the permission.
Sudo chmod R 600 uberx.pem (file name)
Step 11 : using the .pem file command connect to your server,
If connecting for first time, use original IP : ssh i uberx.pem
[email protected]
After elastic IP is set , ssh i uberx.pem [email protected]
Step 12 : To access elastic IP with the instance, click on Elastic IP .
Digital Ocean
We connect to server using Windows Putty
Step 1 : Open puttygen.
Step 2 : Click on load.
Step 3 : Select <AWS CERTIFICATE>.ppk .
Step 4 : Save you certificate as <AWS CERTIFICATE>.ppk
Step 5 : Select <AWS CERTIFICATE>.ppk
Step 6 : Now, open putty .
Step 7 : Enter ,
Hostname as user@publicDNS.
Port as 22
Step 8 : Select Auth of SSh from Category.
Step 9 : Finally to connect your server with putty click on Open.
Server setup
Step 1 : In command prompt install tmux and enter the below mentioned command,
Sudo apt-get install tmux
Step 2 : Copy the sample tmux config from our site i.e.
http://provenlogic.com/tmux.conf
Step 3 : Paste the copied config at your home folder.
Step 4 : in command prompt type below mentioned command,
wget http://provenlogic.com/tmux.conf
mv tmux.conf ~/.tmux.conf
Step 5 : Also add the below mentioned three commands to make the process easy,
tm() { tmux new s $1;}
ta() { tmux attach t$1;}
tl() { tmux listsessions;}
Step 6 : Type vim ~/.bashrc
Step 7 : Copy the above added three commands and paste it at the end of bashrc file
Step 8 : Now run the below mentioned command to make changes effective from
current login session,
source ~/.bashrc
To install phpmyadmin manually
1. At prompt type
sudo apt-get update
sudo apt-get install apache2
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5mysql
2. Now, in a box obtained type password as, uber123!.
3. Type as,
sudo /usr/bin/mysql_secure_installation
sudo mysql_install_db
To auto install phpmyadmin
1. In prompt type,
sudo apt-get install phpmyadmin
sudo service apache2 restart
Link phpmyadmin with apache2
1. Type,
sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/
phpmyadmin.conf
sudo /etc/init.d/apache2 reload
set 'index.php' at first place from fourth place in 'dir.conf' file
2. Type ,
sudo vi /etc/apache2/mods-enabled/dir.conf
3. Copy and paste this piece of code into your '.profile':
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
#ps ${SSH_AGENT_PID} doesn't work under cywgin
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
4. Then fire this commands.
source ~/.profile
5. After this we need to add the deploy key on to the ssh agent for the first time
ssh-add ~/.ssh/uberforxdeploy
6. Make permission to the certificte file('uberforxdeploy') 700 (only owner can access)
7. give permission to 'ubuntu' user to access 'html' folder using command
sudo -i
chown ubuntu .
sudo apt-get install git
Upload for <UberforX - php>.zip file to /var/www/html folder.
sudo mkdir /var/log/apache2/uberforx
8. Create uberforx.conf file and upload that file to
etc/apache2/sites-available/uberforx.conf
give permission .
/*not important (it opens editor to edit this file and paste the following command
but not required)*/
command :vim /etc/apache2/sites-available/uberforx.conf
LIKE:
filename:uberforx.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName <elastic-ip>
DocumentRoot /var/www/html/uberforx/public
<Directory /var/www/html/uberforx/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/uberforx/error.log
CustomLog ${APACHE_LOG_DIR}/uberforx/access.log combined
</VirtualHost>
Enable rewrite
sudo a2enmod rewrite
Enable mcrypt
sudo php5enmod mcrypt
Enable site
sudo a2ensite uberforx.conf
9. Now, install curl in server:
sudo apt-get install php5-curl
10. Restart apache
sudo service apache2 restart
11. Update composer
cd uberforx
curl -sS https://getcomposer.org/installer | php
php composer.phar install
sudo chmod -R 777 app/storage
mkdir public/uploads
sudo chmod -R 777 public/uploads
sudo chmod -R 777 app/storage
sudo chmod -R 777 public/uploads
sudo chmod -R 777 app/config
sudo chmod -R 777 public
sudo chmod -R 777 app/gcm
sudo chmod -R 777 app/ios_push
sudo chmod -R 777 public/stylesheet/theme_cus.css
sudo chmod -R 777 app/lang
sudo chmod -R 777 app/views
sudo chmod -R 777 app/storage/views
sudo chmod -R 644 app/lang/en/customise.php
To Setup database
1. Create a new user and database.
2. Assign user to database,
mysql -uroot -puber123!
create database uberforx;
CREATE USER 'uber'@'localhost' IDENTIFIED BY 'uber123!';
GRANT ALL ON uberforx.* TO 'uber'@'localhost';
To check if user created while we create user through command line
- Update the app/config/database.php file with above mysql details
- Populate the database by running migrations:
php artisan migrate
- Populate initial settings
php artisan db:seed
CronJob command-line setup
sudo mkdir /var/log/<project_name>
sudo chown ubuntu:ubuntu /var/log/<project_name>
touch /var/log/<project_name>/schedule.log
sudo mkdir /var/log/uberforx
sudo chown ubuntu:ubuntu /var/log/uberforx
touch /var/log/uberforx/schedule.log
sudo mkdir /var/log/uberforx
sudo chown root:root /var/log/uberforx
touch /var/log/uberforx/schedule.log
which $EDITOR
EDITOR=vi
export EDITOR
Edit CronJob command
crontab -e
* * * * * curl "http://54.148.195.44/server/schedulerequest" >> "/var/log/uberforx/schedule.log"
2>&1
Install email
sudo apt-get install postfix