Code: Select all
#The process of installing Raspian:
#The process of installing ufw gufw (To check everything is working)
sudo apt-get install ufw gufw
#(SSH)
sudo ufw allow 22
#(Shell)
sudo ufw allow 80
#(Encryption)
sudo ufw allow 443
#(Wordpress)
sudo ufw allow 3306
#(avahi-daemon) (Apple)
sudo ufw allow 5353
#(Enable UFW)
sudo ufw allow ssh
sudo ufw default deny
sudo ufw enable
#sudo ufw disable
# Now manipulate at the bottom of /etc/ssh/sshd_config and add this
sudo nano /etc/ssh/sshd_config
# Insert: AllowUsers pi
# To make sure ssh is safe use your pc address as the only acccess to the RPi by doing this:
sudo nano /etc/network/interfaces
#Enter these details at the bottom:
iface eth0 inet static
address 192.168.1.*** Address of RPi
netmask 255.255.255.0
gateway 192.168.1.*** Address of router
#Then input
sudo ufw allow proto tcp from "your ip address" to any port 22
#Finally
service ssh restart
#Check Status
sudo ufw status verbose
#(MyMediaAlexa) (My Extras)
sudo ufw allow 52050
sudo ufw allow 52051
#Now the process of installing Wordpress via https://projects.raspberrypi.org/en/projects/lamp-web-server-with-wordpress
#1st The process of installing apache
sudo apt-get install apache2 -y
# Test the web server via: http://localhost or RPi's local ip address
#2nd The process of installing php
sudo apt-get install php -y
# To access these files we need to access cd /var/www/html/ folders
cd /var/www/html/
#(Testing)
#If using RPi GUI use leafpad if not use nano
#sudo leafpad index.php
sudo nano index.php
#Insert this and save:
#<?php echo "hello world"; ?>
#if needed
#sudo service apache2 restart
#Then remove old html:
sudo rm index.html
#3rd The process of installing MySQL:
sudo apt install mariadb-server php-mysql -y
#Then:
sudo service apache2 restart
#4th The process of installing wordpress:
# access /var/www/html/
cd /var/www/html/
sudo rm*
#wget:
sudo wget http://wordpress.org/latest.tar.gz
#unwrap
sudo tar xzf latest.tar.gz
#Move
sudo mv wordpress/* .
#Remove old tarball
sudo rm -rf wordpress latest.tar.gz
#Change ownership to apache user
sudo chown -R www-data: .
#5th The process of installing wordpress database:
sudo mysql_secure_installation
#You will be asked Enter current password for root (enter for none): — press Enter.
#Type in Y and press Enter to Set root password?.
#Type in a password at the New password: prompt, and press Enter. Important: remember this root password, as you will need it later to set up WordPress.
#Type in Y to Remove anonymous users.
Type in Y to Disallow root login remotely.
#Type in Y to Remove test database and access to it.
#Type in Y to Reload privilege tables now.
#When complete, you will see the message All done! and Thanks for using MariaDB!.
#Create the WordPress database:
sudo mysql -uroot -p
#Insert these:
create database wordpress;
#If this cdhas been successful, you should see this:
#Query OK, 1 row affected (0.00 sec)
#Now grant database privileges to the root user. Note: you will need to enter your own password after IDENTIFIED BY.
GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
#For the changes to take effect, you will need to flush the database privileges:
FLUSH PRIVILEGES;
#Now exit:
exit
#or Exit the MariaDB prompt with Ctrl + D.
#Now reastart service
sudo service apache2 restart
#Wordpress is now installed and you can proceed to your webpage
*******************************************************************
#The next stage requires editing of the wp-config-sample.php to be later saved as wp-config.php. Make sure you are in /var/www/html/ so:
cd /var/www/html/
sudo nano wp-confi-sample.php
This the code on my php without keys:
*Saved as wp-config.php*
*** and then continuing to finish...***
#[code]
#<?php
#/**
# * The base configuration for WordPress
# *
# * The wp-config.php creation script uses this file during the
# * installation. You don't have to use the web site, you can
# * copy this file to "wp-config.php" and fill in the values.
# *
# * This file contains the following configurations:
# *
# * * MySQL settings
# * * Secret keys
# * * Database table prefix
# * * ABSPATH
# *
# * @link https://codex.wordpress.org/Editing_wp-config.php
# *
# * @package WordPress
#*/
#
#// ** MySQL settings - You can get this info from your web host ** //
#/** The name of the database for WordPress */
#define( 'DB_NAME', 'wpdata' );
#
#/** MySQL database username */
#define( 'DB_USER', 'muppet' );
#
#/** MySQL database password */
#define( 'DB_PASSWORD', 'YadaYadaYada' );
#
#/** MySQL hostname */
#define( 'DB_HOST', 'localhost' );
#
#/** Database Charset to use in creating database tables. */
#define( 'DB_CHARSET', 'utf8' );
#
#/** The Database Collate type. Don't change this if in doubt. */
#define( 'DB_COLLATE', '' );
#
#/**#@+
# * Authentication Unique Keys and Salts.
# *
# * Change these to different unique phrases!
# * You can generate these using the {@link https://api.wordpress.org/#secret-key/1.1/salt/ WordP$
# * You can change these at any point in time to invalidate all #existing cookies. This will forc$
# *
# * @since 2.6.0
#*/
#define( 'AUTH_KEY', 'put your unique phrase here' );
#define( 'SECURE_AUTH_KEY', 'put your unique phrase here' );
#define( 'LOGGED_IN_KEY', 'put your unique phrase here' );
#define( 'NONCE_KEY', 'put your unique phrase here' );
#define( 'AUTH_SALT', 'put your unique phrase here' );
#define( 'SECURE_AUTH_SALT', 'put your unique phrase here' );
#define( 'LOGGED_IN_SALT', 'put your unique phrase here' );
#define( 'NONCE_SALT', 'put your unique phrase here' );
#/**#@-*/
#
Matched to wordpress front page access at the beginning
I'm sure I'm getting confused about users.
Thanks Andyroo