https://www.server-world.info/en/note?os=Debian_9&p=httpd&f=1 ___________________________ sudo apt-get -y install apache2 sudo nano /etc/apache2/conf-enabled/security.conf # line 25: change ServerTokens Prod KLL OK sudo nano /etc/apache2/mods-enabled/dir.conf # line 2: add file name that it can access only with directory's name DirectoryIndex index.html index.htm KLL NO CHANGE sudo nano /etc/apache2/apache2.conf # line 70: add to specify server name ServerName www.srv.world KLL NOT HAVE THAT LINE?? sudo nano /etc/apache2/sites-enabled/000-default.conf # line 11: change to webmaster's email ServerAdmin webmaster@srv.world KLL ServerName www.RPI3.engineering-news.org KLL ServerAdmin raspberryonpi.gmail.com sudo systemctl restart apache2 KLL browser KLL 192.168.1.203 works ___________________________ https://www.server-world.info/en/note?os=Debian_9&p=httpd&f=3 ___________________________ sudo apt-get -y install php php-cgi libapache2-mod-php php-common php-pear php-mbstring sudo a2enconf php7.0-cgi Enabling conf php7.0-cgi. To activate the new configuration, you need to run: sudo service apache2 reload sudo nano /etc/php/7.0/apache2/php.ini # line 924: uncomment and add your timezone KLL date.timezone = "Asia/Bangkok" sudo systemctl restart apache2 ___________________________ sudo nano /var/www/html/index.php
KLL browser http://192.168.1.203/index.php ___________________________ https://www.server-world.info/en/note?os=Debian_9&p=httpd&f=13 ___________________________ sudo apt-get -y install php-fpm sudo nano /etc/php/7.0/fpm/pool.d/www.conf # line 36: change listen = 127.0.0.1:9000 ;KLL ?sure? listen = /run/php/php7.0-fpm.sock listen = 127.0.0.1:9000 sudo nano /etc/apache2/sites-enabled/000-default.conf # add into - SetHandler "proxy:fcgi://127.0.0.1:9000/" sudo a2enconf php7.0-fpm sudo a2enmod proxy_fcgi Considering dependency proxy for proxy_fcgi: Enabling module proxy. Enabling module proxy_fcgi. To activate the new configuration, you need to run: sudo service apache2 restart sudo systemctl restart php7.0-fpm apache2 [4] Create phpinfo and access to it, then it's OK if [FPM/FastCGI] is displayed. sudo echo '' > /var/www/html/info.php KLL sudo nano /var/www/html/info.php KLL add KLL browser http://192.168.1.203/info.php ___________________________ https://www.server-world.info/en/note?os=Debian_9&p=mariadb ___________________________ sudo apt-get -y install mariadb-server sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf # line 111,112: change like follows character-set-server = utf8 #collation-server = utf8mb4_general_ci sudo systemctl restart mariadb !!KLL root [enter] ERROR; use pi and 'pi password' ___________________________ sudo mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorisation. # set root password Set root password? [Y/n] y New password: xxxxx Re-enter new password: xxxxx Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. # remove anonymous users Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. # disallow root login remotely Disallow root login remotely? [Y/n] y !KLL n ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. # remove test database Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. # reload privilege tables Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! # connect to MariaDB with root sudo mysql -u root -p Enter password: # password you set Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 10.1.23-MariaDB-9+deb9u1 Debian 9.0 Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. # show user list MariaDB [(none)]> select user,host,password from mysql.user; +------+-----------+-------------------------------------------+ | user | host | password | +------+-----------+-------------------------------------------+ | root | localhost | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | +------+-----------+-------------------------------------------+ 1 row in set (0.00 sec) # show database list MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.00 sec) MariaDB [(none)]> exit Bye ___________________________ https://www.server-world.info/en/note?os=Debian_9&p=mariadb&f=2 ___________________________ sudo apt-get -y install phpmyadmin php-mbstring php-gettext # select which one you using (this example selects apache2) +------------------------+ Configuring phpmyadmin +-------------------------+ | Please choose the web server that should be automatically configured to | | run phpMyAdmin. | | | | Web server to reconfigure automatically: | | | | [*] apache2 | | [ ] lighttpd | | | | | | | | | +---------------------------------------------------------------------------+ # answer [No] to proceed on this example +------------------------+ Configuring phpmyadmin +-------------------------+ | | | The phpmyadmin package must have a database installed and configured | | before it can be used. This can be optionally handled with | | dbconfig-common. | | | | If you are an advanced database administrator and know that you want to | | perform this configuration manually, or if your database has already | | been installed and configured, you should refuse this option. Details | | on what needs to be done should most likely be provided in | | /usr/share/doc/phpmyadmin. | | | | Otherwise, you should probably choose this option. | | | | Configure database for phpmyadmin with dbconfig-common? | | | | | | | +---------------------------------------------------------------------------+ # change some settings to enable login to phpMyAdmin with root sudo mysql -u root -p mysql Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 11 Server version: 10.1.23-MariaDB-9+deb9u1 Debian 9.0 Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [mysql]> update user set plugin='' where user='root'; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 MariaDB [mysql]> flush privileges; Query OK, 0 rows affected (0.00 sec) MariaDB [mysql]> exit Bye sudo nano /etc/phpmyadmin/apache.conf # line 8: add IP you allow to access Require ip 127.0.0.1 10.0.0.0/24 KLL now can only login from HDMI or VNC browser but not remote browser?? should i add the IP of my LAN PC? sudo systemctl restart apache2 [4] Access to [http://(your hostname or IP address)/phpmyadmin/] and login with a user in MariaDB.