yum install vim mc man telnet
Most cloud virtual machine providers do not set up swapfiles as part of their server provisioning.
If you are running the recommended 2 GB of memory for Discourse, a swap file is technically not required, but can be helpful just in case your server experiences memory pressure. With a swap file, rather than randomly terminating processes with an out of memory error, things will slow down instead.
This can be done at any time from the command line on your server.
Set up a 1 GB swap file
Adding a swap file gives Discourse some extra breathing room during memory-intensive operations. 1GB swap should suffice, though if you are attempting the minimum memory configuration you should set up a 2GB swap.
In the shell you have opened to your droplet, do the following:
swapon -s
sudo install -o root -g root -m 0600 /dev/null /swapfile
dd if=/dev/zero of=/swapfile bs=1k count=1024k
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap auto 0 0" | sudo tee -a /etc/fstab
sudo sysctl -w vm.swappiness=10 echo vm.swappiness = 10 | sudo tee -a /etc/sysctl.conf
yum install mysql-server.x86_64
/etc/init.d/mysql start
yum install httpd.x86_64
/etc/init.d/httpd start
yum install php.x86_64 yum install php-mysql.x86_64
cd ~/public_html/ tar czf babyshopvn.tar.gz babyshopvn/
mysqldump -u'anhvc_babies' -p anhvc_babyshopvn > babyshopvn.sql
(To run scp, you must install openssh-clients both client and server)
ssh -p 2222 anhvc@192.232.218.215
scp -P 2222 anhvc@192.232.218.215:~/public_html/babyshopvn.tar.gz . scp -P 2222 anhvc@192.232.218.215:~/babyshopvn.sql .
mysqladmin create babyshopvn;
mysql -f --default-character-set=utf8 -uroot babyshopvn < babyshopvn.sql
cat /etc/init.d/httpd | grep conf
⇒ Output:
# chkconfig: - 85 15 # config: /etc/httpd/conf/httpd.conf # config: /etc/sysconfig/httpd if [ -f /etc/sysconfig/httpd ]; then . /etc/sysconfig/httpd # Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server echo $"not reloading due to configuration syntax error" failure $"not reloading $httpd due to configuration syntax error" graceful|help|configtest|fullstatus) echo $"Usage: $prog {start|stop|restart|condrestart|try-restart|force-reload|reload|status|fullstatus|graceful|help|configtest}"
⇒ config: /etc/httpd/conf/httpd.conf
cat /etc/httpd/conf/httpd.conf | grep -v '#'
⇒ DocumentRoot:
DocumentRoot "/var/www/html" <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory "/var/www/html"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
Create helloworld.php in /var/www/html
<?php echo "hello world"; ?>
<VirtualHost *:80> ServerName shop.babies.vn DocumentRoot "/data/www/babyshopvn" <Directory /data/www/babyshopvn> Options Indexes FollowSymLinks MultiViews AllowOverride all Order Deny,Allow Allow from all </Directory> ErrorLog logs/shop.babies.vn-error_log CustomLog logs/shop.babies.vn-access_log common </VirtualHost>
/etc/init.d/httpd reload
cat /etc/httpd/conf/httpd.conf | grep -v '#' => User apache Group apache
chown -R apache.apache /data/www
chkconfig httpd on chkconfig mysqld on
mysqladmin password 'newpassword'
Port 1362
PasswordAuthentication no
AllowUsers root anhvc
UseDNS no
Follow tutorial config_debug_mode_in_php
Check error log in: /var/log/httpd/shop.babies.vn-error_log
Follow tutorial change_timezone
yum install php-xml /etc/init.d/httpd restart