1 2 3 4 |
CREATE DATABASE databasename; CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON databasename.* TO 'user'@'localhost'; FLUSH PRIVILEGES; |
1 2 3 4 |
CREATE DATABASE databasename; CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON databasename.* TO 'user'@'localhost'; FLUSH PRIVILEGES; |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
#Add A Record to Point to Server IP cd /etc/nginx/sites-available cat default.conf > subdomain.conf nano subdomain.conf #Wordpress subdomain.conf Contents server { listen 80; root /var/www/html/blog; index index.php index.html index.htm; ################################################### server_name blog.domain.com; # WordPress single site rules. # Designed to be included in any server {} block. # This order might seem weird - this is attempted to match last if rules below fail. # http://wiki.nginx.org/HttpCoreModule location / { try_files $uri $uri/ /index.php?$args; } # Add trailing slash to */wp-admin requests. rewrite /wp-admin$ $scheme://$host$uri/ permanent; # Directives to send expires headers and turn off 404 error logging. location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; } # Uncomment one of the lines below for the appropriate caching plugin (if used). #include global/wordpress-wp-super-cache.conf; #include global/wordpress-w3-total-cache.conf; # Pass all .php files onto a php-fpm/php-fcgi server. location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; if (!-f $document_root$fastcgi_script_name) { return 404; } # This is a robust solution for path info security issue and works with "cgi.fix_pathinfo = 1" in /etc/php.ini (default) include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # fastcgi_intercept_errors on; fastcgi_pass 127.0.0.1:9000; } location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } location ~ /\. { deny all; } location ~* /(?:uploads|files)/.*\.php$ { deny all; } } #test nginx nginx -t #restart nginx service nginx restart |
1 2 3 4 5 |
#You need to have the EPEL Repo Installed = yum -y install epel-release ^ yum repolist yum install beanstalkd chkconfig beanstalkd on service beanstalkd start service beanstalkd status |
1 2 3 4 5 6 7 |
nano /etc/chkserv.d/beanstalkd service[beanstalkd]=x,x,x,/etc/init.d/beanstalkd restart,beanstalkd,root|beanstalkd #Add this line to /etc/chkserv.d/chkservd.conf beanstalkd:1 #If you need to /scripts/restartsrv_tailwatchd as chkservd is now a part of tailwatch |
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
Reset it with the following steps
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#Stop mysql service /etc/init.d/mysql stop #Start the MySQL server w/o password mysqld_safe --skip-grant-tables & #Connect to the MySQL server without password mysql -u root #Set a new MySQL root user password mysql> use mysql; mysql> update user set password=PASSWORD("NEW-PASSWORD") where User='root'; mysql> flush privileges; mysql> quit #Stop mysql service /etc/init.d/mysql stop #Start mysql service /etc/init.d/mysql start #now you can login with password mysql -u root -p |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
#How to block an IP using iptables? iptables -A INPUT -s xx.xx.xx.xx -j DROP #How to block an IP for a specific port: iptables -A INPUT -p tcp -s xx.xx.xx.xx --dport PORT -j DROP #How to allow access to an IP? iptables -A INPUT -s xx.xx.xx.xx -j ACCEPT #How to allow access to an IP to a specific port using iptables? iptables -A INPUT -p tcp -s xx.xx.xx.xx --dport PORT -j ACCEPT #See if SSHD is running and listen to port netstat -tlpn mkdir .ssh chmod 700 .ssh nano .ssh/authorized_keys chmod 600 .ssh/authorized_keys #restart ssh ubuntu /etc/init.d/ssh |