setup raspberry pi
sudo dpkg-reconfigure tzdata
sudo apt-get update
sudo apt-get upgradekeep firmware up to date
sudo apt-get install ca-certificates
sudo apt-get install git-coresudo
wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-updatesudo rpi-updatesudo shutdown -r now
setup SSH
connect to raspberry pi by ssh
ssh pi@192.168.0.4
install php and apache
sudo apt-get install apache2 php5 libapache2-mod-php5
if get installation error, run
sudo groupadd www-datasudo usermod -g www-data www-datarestart service
sudo service apache2 restart
Now enter the I.P. address of your Raspberry Pi into your web browser, and you should see a simple page that says "It Works!"
install mysql
sudo apt-get install mysql-server mysql-client php5-mysqlinstall ftp
sudo chown -R pi /var/www
sudo apt-get install vsftpd
configure ftp
sudo nano /etc/vsftpd.confChange anonymous_enable=YES toanonymous_enable=NO, Uncomment local_enable=YES and write_enable=YES, then go to the bottom of the file and add force_dot_files=YES. Now save and exit the file.
restart vsftp
sudo service vsftpd restart
sudo passwd rootLog out of your SSH session, and log back in as root. (You MUST do this)
Edit the password configuration file:
nano /etc/passwd
Find the line pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash and add a # sign to the beginning of it. Now save and exit the file.
- NOTE: This step has been known to cause errors, and lock people out of their Raspberry Pi. After saving the file, open a new SSH window and try to login as pi. If you get an access denied message, remove the # sign in front of: pi:x;1000:1000:Raspberry Pi User,,,:home/pi:/bin/bash
add the user pi as mod
usermod -d /var/www pi
Now exit your SSH session, and log back in as pi, then grant mod rights toroot.
sudo usermod -L root
Now exit. Your server should be up and running. You can transfer files through FTP by using your servers IP, and connecting through port 21.
ที่มา http://www.wikihow.com/Make-a-Raspberry-Pi-Web-Server
ไม่มีความคิดเห็น:
แสดงความคิดเห็น