Author: lingchitao_admin

  • mysql workbench `root`@`localhost` user getting denied access

    $ mysql mysql> USE mysql; mysql> UPDATE user SET plugin=’mysql_native_password’ WHERE User=’root’; mysql> FLUSH PRIVILEGES; mysql> exit; $ service mysql restart

  • Error 1045: Access denied for ‘debian-sys-maint’

    mysql -u root -p # enter password GRANT ALL PRIVILEGES ON . TO ‘debian-sys-maint’@’localhost’; exit

  • Fix for slow php mail() function – ubuntu – sendmail

    hostname sudo vi /etc/hosts // Change localhost [hostname (whatever your hostname is)] // To localhost localhost.localdomain [hostname] sudo service apache2 restart

  • Setup PHP email function – ubuntu – sendmail

    sudo apt-get install sendmail // Proceed to php.ini [mail function] ; Setup for Linux systems sendmail_path = /usr/sbin/sendmail -t sendmail_from = [email protected] [mail function] ; Setup for Windows systems SMTP = sendmail_from = [email protected]

  • Install an FTP Server (with OpenSSH) – ubuntu

    sudo apt-get install vsftpd vi /etc/vsftpd.conf // Uncomment write_enable=YES local_umask=022 chroot_local_user=YES // Add allow_writeable_chroot=YES pasv_enable=Yes pasv_min_port=40000 pasv_max_port=40100 // End sudo service vsftpd restart sudo useradd -m ftpuser -d /var/www/html -s /usr/sbin/nologin sudo passwd ftpuser Continue for openssh encryption sudo apt-get install openssh-server sudo groupadd ftpaccess vi /etc/ssh/sshd_config // Comment Subsystem sftp /usr/lib/openssh/sftp-server // Add Subsystem…

  • Install an FTP Server – fedora

    sudo yum install vsftpd cd /etc/vsftpd sudo vi vsftpd.conf Change: anonymous_enable=NO Add: #Replace with your IP pasv_enable=YES pasv_min_port=14000 pasv_max_port=14050 port_enable=YES pasv_address= pasv_addr_resolve=NO sudo service vsftpd start sudo chkconfig vsftpd on sudo /etc/init.d/vsftpd restart

  • Setup WordPress on Fedora

    Commands (Cont. for wordpress) cd /var/www/html sudo wget sudo tar -xzvf latest.tar.gz sudo rm -r latest.tar.gz sudo mv wordpress [name of folder] — EITHER // move contents one level up mv [name of folder]/* . rmdir [name of folder] — OR // go into directory cd [name of folder] sudo mv wp-config-sample.php wp-config.php sudo…

  • Setup .htaccess (Ubuntu)

    Commands (Ubuntu) sudo a2enmod rewrite sudo service apache2 restart vi etc/apache2/apache2.conf change AllowOverride None to AllowOverride All (see below) Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all sudo service apache2 restart

  • Setup .htaccess (Fedora)

    Command (Fedora) sudo vi /etc/httpd/conf/httpd.conf Change AllowOverrider to “All” for html directory Change for both and the one outside, then run sudo apachectl -k restart sudo service httpd restart Finally, make changes to htaccess (look at the bottom of permalinks page in WP)

  • Setup Php-MySql Server

    Commands (Fedora) sudo yum update sudo su yum install httpd service httpd start yum install php php-mysql yum install mysql-server service mysqld start mysqladmin -uroot create [name of sql database] mysql_secure_installation [enter your choosen password] y y y y