1) First, clean-up yum: sudo yum clean all
2) As a matter of best practice we’ll update our packages: sudo yum -y update
3) Installing Apache is as simple as running just one command: sudo yum -y install httpd
4) And then start Apache: sudo systemctl start httpd
5) Be sure that Apache starts at boot: sudo systemctl enable httpd
6) To check the status of Apache: sudo systemctl status httpd
7) To stop Apache: sudo systemctl stop httpd
Hidden folder listing using .htaccess file
create .htaccess file in document root directory and just write –
Options -Indexes
Setup server for python ubuntu 16.04 LTE
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install apache2
sudo apt-get install python-pip
python –version
sudo pip install –upgrade pip
sudo pip install –upgrade virtualenv
sudo apt-get install mysql-server libmysqlclient-dev
cd document root
virtualenv myvenv
source myvenv/bin/activate
pip freeze (show install modules)
pip install Django
pip install mysqlclient
How to install Mongodb on centos
1) sudo vi /etc/yum.repos.d/mongodb-org-3.6.repo
press i : for insert mode
then write –
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
2) sudo yum update
3) sudo yum install mongodb-org
4) sudo systemctl start mongod
5) sudo systemctl reload mongod
6) sudo systemctl enable mongod
7) sudo yum install php-mongo
8) sudo apachectl restart
More – Mongodb
What is Artificial Intelligence Exactly
Linux Command
sudo : superuser do
sudo -i : for change other user to user root
cd : change directory
ls : listing
ls -la : listing with full information of files or folder
/ : root directory
~ : home directory
.. : for previous directory
. : current directory
cp fileName copyLocation
scp -r folder/file copyLocation
rm -rf fileName/folderName : remove directory
top : for mysql running query list
du -sh fileName/FolderName : for file or folder size information
df -h : system all memory information
pwd : present working directory
zip filename.zip fileName/folderName
unzip filename.zip : unzip file
to be continue…
Create, import and export mysql database using terminal
1) To Export a database, open up terminal, making sure that you are not logged into MySQL and type
mysqldump -u [username] -p [database name] > [database name].sql
mysqldump -u root -p admin_ghc > admin_ghc.sql
2) To import a database, first create a new blank database in the MySQL shell to serve as a destination for your data.
CREATE DATABASE newdatabase;
mysql -u [username] -p newdatabase < [database name].sql
3) stop the MySQL process
/etc/init.d/mysql stop
Login with PEM file from Terminal
1) Download PEM file and then give permission 0400
sudo chmod -R 0400 name.pem
2) Then login with PEM file
ssh -i name.pem ubuntu@ip_address
Set up AWS Server in ubuntu 16.04 LTS
1) sudo apt-get update
2) sudo apt-get upgrade
3) sudo vi /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
4) sudo reboot
5) sudo apt-get install mysql-server mysql-client
6) sudo apt-get install apache2 apache2-dev
7) sudo apt-get install php libapache2-mod-php libapache2-mod-wsgi libmysqlclient-dev php-zip zip php-mcrypt php-mbstring php-curl curl build-essential
8) sudo /etc/init.d/apache2 restart
9) sudo apt-get install sendmail
10) sudo apt-get install phpmyadmin
11) sudo vim /etc/apache2/apache2.conf
# phpMyAdmin Configuration
Include /etc/phpmyadmin/apache.conf
12) sudo /etc/init.d/apache2 restart
13) sudo apt-get install vsftpd
14) sudo vim /etc/vsftpd.conf
uncomment write_enable=YES
uncomment chroot_local_user=YES
Add at last in file
user_sub_token=$USER
local_root=/var/www/html/
allow_writeable_chroot=YES
15) sudo adduser username
16) sudo chown username: username /var/www/html
17) sudo chmod a-w /var/www/html/
18) sudo chmod -R 0777 /var/www/html
19) sudo service vsftpd restart
20) sudo a2enmod rewrite
21) sudo service apache2 restart
22) sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
sql_mode = ''
23) sudo vi /etc/php/7.0/apache2/php.ini
change upload_max_filesize = 2M -> upload_max_filesize = 50M
24) sudo service apache2 restart
Get efficient server
Easily deploy an SSD cloud server on @DigitalOcean in 55 seconds. Sign up using my link and receive $10 in credit: https://m.do.co/c/ededa6a4a1a2