Raspberry Pi Webserver

27K1487

Intro: Raspberry Pi Webserver

Wenn ihr euer Raspberry PI (2) A / B (+) mit Raspbian und aktiviertem SSH bereit habt, können wir sofort loslegen.

Für wen ist dieser (Web)Server geeignet?

Das Raspberry Pi ist schlicht zu langsam, um eine vollwertiger Server zu sein, was mit einigen Einschränkungen doch relativ gut geht.

STEP 1: 1. Schritt

Als erstes machen wir mit

sudo apt-get update

und

sudo apt-get upgrade

ein Update und Upgrade des Betriebssystems

Jetzt kommt die eigentliche Installation.
Als erstes den Apache Webserver mit PHP 5

sudo apt-get install apache2 php5 libapache2-mod-php5

Bei der Frage " Do you want to continue" einfach "Y" drücken.

sudo groupadd www-data und
sudo usermod -g www-data www-data

sudo service apache2 restart

Jetzt haben wir den Server installiert. Um ihn zu testen müssen sie einfach die IP des Raspberrys in die Adresszeile des Browser eingeben. Es sollte eine Website mit dem Text "It Works" oder so kommen.

sudo nano /etc/apache2/sites-enabled/000-default

um .htacces dateien zu erlauben. Nach "AllowOverride None" suchen und in "AllowOverride ALL" umschreiben. Danach mit der Tastenkobination Strg + X dann Y Speichern und die Datei schließen

Jetzt starten wir den Server mit sudo service apache2 restart Neustarten.

STEP 2: 2. Schritt MySQL Und FTP

Installation von MySQL

sudo apt-get install mysql-server mysql-client php5-mysql

Bei der Frage "Do you want to continue" einfach "Y" drücken.
Sie werden nach ihrem neuen MySQL Passwort gefragt (geben sie einfach ein neues Passwort ein) Sie müssen das gleiche Passwort zur bestätigung ein 2. Mal eingeben.
Nach einer kleinen Wartezeit haben sie erfolgreich MySQL installiert.

Installation vom FTP Server


sudo chown -R pi/var/www
sudo apt-get install vsftpd

sudo nano /etc/vsftpd.conf

Suchen sie nach "anonymous_enable=YES"

"#local_enable=YES"

"#write_enable_YES"

Und ersetzen sie jeweils durch:

"anonymous_enable=NO"

"local_enable=YES"

"write_enable=YES"

Und fügen sie ganz unten: "force_dot_files=YES" hinzu

sudo service vsftpd restart

Den FTP Server neustarten.

Bei jedem verbindem über FTP müssen sie Manuell in
das Verzeichnis /var/www wechseln.

7 Comments

If you have your Raspberry PI (2) A / B (+) with Raspbian and activated SSH ready, we can get started right away.For whom is this (web) server suitable?The Raspberry Pi is simply too slow to be a full-fledged server, which is relatively good with some restrictions.Step 1: Step 1First, let's goSudo apt-get updateandSudo apt-get upgradeAn upgrade and upgrade of the operating systemNow comes the actual installation.First, the Apache web server with PHP 5Sudo apt-get install apache2 php5 libapache2-mod-php5In the question "Do you want to continue" simply press "Y".Sudo groupadd www-data andSudo usermod -g www-data www-dataSudo service apache2 restartNow we have installed the server. To test it, you simply have to enter the IP of the Raspberry into the browser's address line. There should be a website with the text "It Works" or something.Sudo nano / etc / apache2 / sites-enabled / 000-defaultTo allow .htacces files. Search for "AllowOverrideNone" and rewrite it in "AllowOverride ALL". Then use the keyboard shortcut Ctrl + X to save Y and close the fileNow we start the server with sudo service apache2 restart restart.Step 2: Step 2 MySQL and FTPInstalling MySQLSudo apt-get install mysql-server mysql-client php5-mysqlIn the question "Do you want to continue" simply press "Y".You will be asked for your new MySQL password (just enter a new password) You must enter the same password for the second time.After a small wait, they have successfully installed MySQL.Installation from FTP server
Sudo chown -R pi / var / wwwSudo apt-get install vsftpdSudo nano /etc/vsftpd.confSearch for "anonymous_enable = YES""# Local_enable = YES""#write_enable_YES"And replace them with:"Anonymous_enable = NO""Local_enable = YES""Write_enable = YES"And add it at the bottom: "force_dot_files = YES"Sudo service vsftpd restartReboot the FTP server.For each connected via FTP, they must be Manual inThe directory / var / www.

Translation from German:

Step 1

The first thing we do with

sudo apt-get update

and

sudo apt-get upgrade

an update and upgrade the operating system

Now comes the actual installation.
First, the Apache web server with PHP 5

sudo apt-get install apache2 php5 libapache2-mod-php5

press When asked "Do you want to continue" simple "Y".

sudo groupadd www-data und
sudo usermod -g www-data www-data

sudo service apache2 restart

Now we have installed the server. they need to test it just to enter the IP of Raspberrys in the address bar of the browser. There should be a website with the text "It Works" or happen.

sudo nano /etc/apache2/sites-enabled/000-default

to permit .htaccess files. After " AllowOverride None Search" and "AllowOverride ALL rewrite". After that close the Tastenkobination Ctrl + X Y Save the file and

Now we start the server with sudo service apache2 restart restarting.

Translation from German:

Step 2: MySQL and FTP

Installation of MySQL
sudo apt-get install mysql-server mysql-client php5-mysql

Simply press When asked "Do you want to continue" "Y".
You will be asked for your new MySQL password (they enter a new password) you need to enter the same password for confirmation a second time.
After a short waiting time they have successfully installed MySQL.

Installation from FTP server

sudo chown -R pi/var/www
sudo apt-get install vsftpd

sudo nano /etc/vsftpd.conf

Search it for " anonymous_enable = YES "

"#local_enable=YES"

"#write_enable_YES"

And they replaced respectively by:

"anonymous_enable=NO"

"local_enable=YES"

"write_enable=YES"

And they add at the bottom: " force_dot_files = YES " added

sudo service vsftpd restart

The FTP server restart.

Each verbindem via FTP must manually in
change directory / var / www.


In English please

Use Google Chrome and hit "Translate"

Thanks for sharing! I love anything to do with the Raspberry Pi!