When I received my first Raspberry Pi 2, I thought: “maybe I can use it as a web server to host a few of my websites”. Trying different configurations and security options, I had to start all over a few times… Hours and hours redoing more or less the same things again and again. Now […]
Raspberry Pi 3 – Integrated Wi-Fi setup
Hello Devz, I received my new Raspberry Pi 3 today with its integrated Wi-Fi, and I was wondering how to setup the ip address in a permanent way with console only.
1 | sudo nano /etc/network/interfaces |
Then find a line containing “wlan0” (zero) and replace the text by this:
1 2 3 4 5 6 | allow-hotplug wlan0 auto wlan0 iface wlan0 inet dhcp wpa-ssid "ssid" wpa-psk "password" |
Enjoy!
Raspberry Pi – Raspberry phpmyadmin installation
Hello Devz, Are you looking to control and configure a php server on your Linux or Raspberry Pi machine? Here are simple steps for Raspberry phpmyadmin installation.
1 | sudo apt-get install phpmyadmin |
Using the above command line, you will be asked to choose the web server installed in the system, which is either Apache2 or Lighttpd. In this case, you […]
Raspberry Pi: Install a web server – the easy and fast way
Hello Devz, NGINX (pronounced engine x) is a popular lightweight web server application you can install on the Raspberry Pi to allow it to serve web pages. Like Apache, NGINX can serve HTML files over HTTP, and with additional modules can serve dynamic web pages using scripting languages such as PHP. INSTALL NGINX First install […]
Raspberry Pi – Useful commands for your web server
Hello Devz, Here are some simple steps to configure your own web server: INSTALL WORDPRESS
1 2 3 4 5 6 7 | sudo mkdir -p /var/www/html/mywebsite cd /var/www/html/mywebsite sudo wget http://wordpress.org/latest.tar.gz tar --strip-components=1 -xvf latest.tar.gz rm latest.tar.gz sudo chown -R www-data:www-data /var/www/html/mywebsite sudo chmod -R 755 /var/www/html/website |
KILL THE FIREWALL
1 2 3 4 5 6 7 8 9 | sudo iptables -F sudo iptables -X sudo iptables -t nat -F sudo iptables -t nat -X sudo iptables -t mangle -F sudo iptables -t mangle -X sudo iptables -P INPUT ACCEPT sudo iptables -P OUTPUT ACCEPT sudo iptables -P FORWARD ACCEPT |
CHECK YOUR WEB SERVER STATUS
1 2 3 4 5 6 7 | /etc/init.d/nginx status sudo nginx -t /etc/init.d/php5-fpm status ls -la /var/run/php5-fpm.sock sudo cat /var/log/php5-fpm.log cat /var/log/nginx/access.log cat /var/log/nginx/error.log |
UPLOAD MAX FILE SIZE CONFIG FOR PHP and NGINX
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | /etc/php5/fpm/php.ini --> upload_max_filesize = 256M --> post_max_size = 256M sudo nano /etc/nginx/nginx.conf http { ...... client_max_body_size 200M; ...... } /etc/nginx/sites-available/default server { ..... client_max_body_size 256M; ...... } sudo service php5-fpm reload sudo service nginx reload |
UNINSTALL YOUR WEBSERVER
1 2 | sudo apt-get purge nginx nginx-common php5-fpm php5-curl php5-gd php5-cli php5-mcrypt php5-mysql php-apc mysql-server sudo apt-get autoremove |
Enjou! 🙂
Pi Web Server – Part 2: Setting up your first website
Hello Devz, Here are the simple steps to configure your existing web server: Create the directory for your website’s files Lets make our first simple website. I’m hosting all mine on the external USB drive I mounted earlier. In the directory /data. Type:
1 | sudo mkdir -p /data/mysite.com/www |
1 | sudo mkdir -p /data/mysite.com/logs |
All your PHP/HTML/CSS etc will live in /data/mysite.com/www, and all […]
Pi Web Server – Part 1: Install Nginx, PHP and MySQL
Install Nginx, PHP and MySQL I’m going to use nginx rather than the more traditional Apache2, because it is more efficient and on a low-power device like the Pi that’s going to be important. I’m also going to install PHP5 (with PHP APC to make it faster than normal) and MySQL as these are pretty […]
Securing your Raspberry Pi – Part 2: Firewall
Creating a Firewall Now it’s time to set up a firewall to limit and block unwanted inbound traffic to your Pi. This step is optional, but we strongly recommend that you use the example below to block traffic to ports that are not commonly used. It’s a good way to deter would-be intruders! You can […]