Raspberry Pi Web Server
INSTALL APACHE
Apache is a popular web server application you can install on the Raspberry Pi.
Setting up an Apache Web Server on a Raspberry Pi.
First install the apache2 package by typing the following command in to the Terminal:
sudo apt-get install apache2 -y
Test LocalHost use web browser and input your IP address. ( My IPaddress is 192.168.0.101 )
If you don't know your ip address use this command.
If It's work. show html page.
PHP is a preprocessor. it's code that runs when the server receives a request for a web page. It runs, works out what needs to be shown on the page, then sends that page to the browser. Unlike static HTML, PHP can show different content under different circumstances. Other languages are capable of this, but since WordPress is written in PHP, that's what we need to use this time. PHP is a very popular language on the web; large projects like Facebook and Wikipedia are written in PHP.
Install the PHP and Apache packages with the following
command:
sudo apt-get install php5 libapache2-mod-php5 -y
CHANGING THE DEFAULT WEB PAGE
This default web page is just a HTML file on the filesystem. It is located at /var/www/html/index.html
Note: The directory was /var/www in Raspbian Wheezy but is now /var/www/html in Raspbian Jessie
TEST php file
Create index.php file
Edit Code
Test on Browser
your_ip_address/index.php
INSTALL MYSQL
MySQL (pronounced My Sequel or My S-Q-L) is a popular database engine. Like PHP, its overwhelming presence on web servers enhanced its popularity. This is why projects like WordPress use it, and why those projects are so popular.
Install the MySQL Server and PHP-MySQL packages by entering the following command into the terminal:
sudo apt-get install mysql-server php5-mysql -y
It will be take a long time.
When installing MySQL you will be asked for a root password. You'll need to remember this to allow your website to access the database.
Now restart Apache:
sudo service apache2 restart
INSTALL PHPMyAdmin
phpMyAdmin is an open source tool used for the administration of MySQL. In addition to offering the capability to perform administration tasks such as creating, editing, or deleting databases, and managing users and permissions, phpMyAdmin provides a graphical user interface to do all of these tasks and more.
sudo apt-get install phpmyadmin -y
As the installation runs you’ll be asked a few simple questions regarding the basic configuration of phpMyAdmin.
At the first screen, select apache2 by using the space bar, then hit enter to continue.
At the second screen, which asks “configure the database for phpmyadmin with dbconfig-common?”, select Yes, then hit enter to continue.
At the third screen enter your MySQL password, then hit enter to continue.
Open Web Browser
Goto your_ipaddress/phpmyadmin ( xxx.xxx.x.xx/phpmyadmin )
or http://localhost/phpmyadmin
You 'll see PHPMyAdmin Login Page.
Username is root and Your Password
Now You can use Raspberry Pi Web Server.
My Website
email : info@softpowergroup.net Tel .081-6452400
ไม่มีความคิดเห็น:
แสดงความคิดเห็น