Skip to main content

Posts

list of mysql commands

here are tutorial list of mysql commands to preparing database for your web+cms needs enter database server by using mysql client  $ mysql -u root mysql to create database mysql> CREATE DATABASE namedb; to create user database and password mysql>CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; to grant access user to database create mysql>GRANT ALL ON namedb.* TO 'user'@'localhost'; to make configuration active mysql>FLUSH PRIVILEGES; to exit mysql mysql>EXIT to show user, host and password mysql>SELECT user,host,password FROM user; to show databases mysql>SHOW DATABASES; to open database mysql>USE namedb; to remove database mysql>DROP DATABASE namedb; to remove user mysql>DROP USER 'user'@'localhost'; to backup all databases mysql>MYSQLDUMP --all-databases > backup.sql to restore database mysql>MYSQL -u username -p < backup.sql

how to enable name-based virtual hosting httpd

here are tutorial to enable name-based virtual hosting httpd # /etc/httpd/conf/httpd.conf locate Section 3 from the configuration file, uncomments few lines or create new lines parameter  NameVirtualHost *:80 <VirtualHost *:80>       ServerName yourfirstwebsite.domain       DocumentRoot "/var/www/html/" </VirtualHost>    <VirtualHost *:80>       ServerName yoursecondwebsite.domain       DocumentRoot "/var/www/html2/" </VirtualHost> save your configuration and please kindly restart your httpd service      

how to enable httpd to access to homedir

here are the notes how to enable accessing homedir for httpd enable access to home user directory # /etc/httpd/conf/httpd.conf locate UserDir section <IfModule mod_userdir.c> # # # UserDir disabled                       (comments this line) # # to allow httpd accessing homedir set selinux by typing this command on terminal # setsebool -P httpd_enable_homedirs 1 # chcon -R -t httpd_sys_content_t ~username/public_html example. #  chcon -R -t httpd_sys_content_t ~belogix/public_html  notes: ~userid directory must have permission 711 ~userid/public_html/ directory must have permission 755 check your setting by open your web browser pointed to http://ipaddrwebserver/~user/

about vsftpd settings

here the notes about configurations setting for vsftp daemon vsftpd defaults 1. port default : tcp/udp 21 & 20 2. main configuration files : /etc/vsftpd/vsftpd.conf 3. users that are not allowed to login via ftp : /etc/vsftpd/ftpusers turn on verbose vsftpd log format. the default log is /var/log/vsftpd.log log_ftp_protocol = YES create warning banners for all ftp users banner_file = /etc/vsftpd/issue (where file 'issue' is located on /etc/vsftpd/) add additional users to ftp server to login, upload and download files # useradd -c 'FTP USER oracle' -m belogix # passwd belogix local_enable = YES

how to change rootdir vsftpd

as default root directory for vsftpd is located in /var/ftp/pub/. to change the defaults do this step : # /etc/vsftpd/vsftpd.conf add the line below anon_root = your_directory example anon_root = /home/user/ftp/ # /etc/selinux/config set selinux to disable/permissive mode

about vsftpd module helper (ip_conntrack)

vsftpd modul helper (ip_conntrack) # /etc/sysconfig/iptables add the lines to open port tcp 21 for vsftpd -A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT # /etc/sysconfig/iptables-config edit the lines below # Load additional iptables modules (nat helpers) # Default: -none- # # IPTABLES_MODULES="ipconntrack_ftp ip_nat_ftp" # # restart service # service iptables restart The ip conntrack ftp module is used by iptables to listen to traffic and allow connections to the data ports (20). This allows an FTP server to operate on a machine which is running a firewall. Without this option passive ftp will not work. Another option is just skip this module assign min and max pass ranges in vsftpd and open those ports. source: http://www.cyberciti.biz/tips/rhel-fedora-centos-vsftpd-installation.html

public yum oracle linux repository

[ol6_latest] name=Oracle Linux $releasever Latest ($basearch) baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/latest/$basearch/ gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 gpgcheck=1 enabled=1 [ol6_ga_base] name=Oracle Linux $releasever GA installation media copy ($basearch) baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/0/base/$basearch/ gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 gpgcheck=1 enabled=0 [ol6_u1_base] name=Oracle Linux $releasever Update 1 installation media copy ($basearch) baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/1/base/$basearch/ gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 gpgcheck=1 enabled=0 [ol6_u2_base] name=Oracle Linux $releasever Update 2 installation media copy ($basearch) baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL6/2/base/$basearch/ gpgkey=http://public-yum.oracle.com/RPM-GPG-KEY-oracle-ol6 gpgcheck=1 enabled=0 [ol6_u3_base] name=Oracl...