Xampp Raspberry Pi

Installing XMPP/Jabber messaging server

XMPP/Jabber is open simple protocol for messaging. It is very good replacement for previously famous messaging services like ICQ, AIM, MSN.. Main disadvantage of these services was that if they was not acessible for some time, you couldn`t do anything.. and second, all was proprietary protocols so you could use only official client programs (in most cases full of advertisements). Unofficial clients was not always working like they should. If I can I will always choose open source alternative over proprietary piece of software. In case of instant messaging too. Jabber adresses work in the same way as standard email addresses - it is composed of 2 parts: [email protected] You can use some providers which will provide you Jabber account for free (list here), but you can also build your own server. So why not to run XMPP/Jabber server on my Raspberry Pi. I strongly recommend using domain instead of IPs and ensure that RPi is accessible under static IP address. All will work even without this two things but will sooner or later they will cause problems.
There are more XMPP/Jabber server implementation for RPi. The most used are Prosody and ejabberd. Prosody is much more lightweight but ommit some advanced functions. So I decided to install it.

Turning Your Raspberry Pi Into a Personal Web Server: LAMP is an acronym that stands for LinuxApacheMySQLPHP and are components required to run a Dynamic HTML webpage. This instructable will demonstrate how you can turn your Raspberry Pi into a personal web server. Setting up an Apache Web Server on a Raspberry Pi Apache is a popular web server application you can install on the Raspberry Pi to allow it to serve web pages. On its own, Apache can serve HTML files over HTTP, and with additional modules can serve dynamic web. XAMPP is a package that installs Apache, MariaDB, PHP and Perl onto Windows, Linux or Mac. You can turn your Raspberry Pi with Raspberry PI OS into a full LAMP.

apt-get install prosody
After succesful installation open its main configuration file
nano /etc/prosody/prosody.cfg.lua
In configuration file add this line, change domain according to yours
VirtualHost 'domain.com'
Now there are some other directories you should edit
admins = {'[email protected]'} # this account will have rights to administer server through messages
allow_registration = true # set to true or false, if you want that anybody can create account through IM client
welcome_message = 'Welcome $user' # message shown to newly registered accounts
registration_watchers = {'[email protected]'} # informs admin about new registrations
Now close and save configuration file and restart Prosody
/etc/init.d/prosody restart
Now create a administrator account for prosody manually. In the terminal write
prosodyctl adduser [email protected]
On other device install some Jabber client and try to connect to this account. Everything should work. It is not common to use admin account for messaging, create another account, for example via Pidgin.
If you choose to not allow registration of new acconts, you will have to create all accounts in command line. use this commands, they are quite self-explanationary.
prosodyctl adduser [email protected] # adds a new user
prosodyctl deluser
[email protected] # deletes an existing account
prosodyctl passwd [email protected] # change password to existing account
Xampp
Now you should be able to send messages to people from other domains, not only yours.
NOTE: If you are using standard ports for Jabber server you do not have to set this. If you changed default ports, you will have to set SRV DNS records.
_xmpp-server._tcp.domain.com. IN SRV 0 0 5269 hostname.
_xmpp-client._tcp.domain.com. IN SRV 0 0 5222 hostname.
_jabber._tcp.domain.com. IN SRV 0 0 5269 hostname.
There are 3 records, first is port for server to server communication, second is for client to server communication. Third is only for backwards compatibility, set there the same port as in server to server statement.
NOTE2: In client to server communication is used asymetric certificate. Its keys are automaticaly generated at installation, but you can also get validated certificates for your Jabber server from StartSSL for free.

Apache is a popular web server application you can install on the Raspberry Pi to allow it to serve web pages.

On its own, Apache can serve HTML files over HTTP, and with additional modules can serve dynamic web pages using scripting languages such as PHP.

Install Apache

First, update the available packages by typing the following command into the Terminal:

Then, install the apache2 package with this command:

Test the web server

Xampp

By default, Apache puts a test HTML file in the web folder. This default web page is served when you browse to http://localhost/ on the Pi itself, or http://192.168.1.10 (whatever the Pi's IP address is) from another computer on the network. To find the Pi's IP address, type hostname -I at the command line (or read more about finding your IP address).

Browse to the default web page either on the Pi or from another computer on the network and you should see the following:

This means you have Apache working!

Changing the default web page

This default web page is just an HTML file on the filesystem. It is located at /var/www/html/index.html.

Navigate to this directory in a terminal window and have a look at what's inside:

This will show you:

This shows that by default there is one file in /var/www/html/ called index.htmland it is owned by the root user (as is the enclosing folder). In order to edit the file, you need to change its ownership to your own username. Change the owner of the file (the default pi user is assumed here) using sudo chown pi: index.html.

You can now try editing this file and then refreshing the browser to see the web page change.

Xampp Raspberry Pi 4

Your own website

If you know HTML you can put your own HTML files and other assets in this directory and serve them as a website on your local network.

Additional - install PHP

To allow your Apache server to process PHP files, you'll need to install the latest version of PHP and the PHP module for Apache. Type the following command to install these:

Now remove the index.html file:

Xampp Auf Raspberry Pi Installieren

and create the file index.php:

Put some PHP content in it:

Now save and refresh your browser. You should see 'hello world'. This is not dynamic but still served by PHP. Try something dynamic:

or show your PHP info:

Further - WordPress

Now you have Apache and PHP installed you can progress to setting up a WordPress site on your Pi. 6:22 utc time zone. Continue to WordPress usage.