Clone this repo to any folder, copy the contents from ./webrtc-chat-SED/ to /var/www/html/
$ cd public
$ composer install
cd /var/www/webchatsed.org/public
php5.6 src/chat-server.php
$ sudo mkdir -p /var/www/webchatsed.org
$ sudo chown -R $USER:$USER /var/www/webchatsed.org
$ sudo adduser $USER www-data
$ chmod -R 775 /var/www/webchatsed.org
$ cd /var/www/webchatsed.org
$ git clone https://github.com/JDAlvarenga/webrtc-chat-SED.git .
$ cd public
$ composer install
$ sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/webchatsed.org.conf
Open the new file in your editor with root privileges:
$ sudo nano /etc/apache2/sites-available/webchatsed.org.conf
The file will look something like this (I've removed the comments here to make the file more approachable):
<VirtualHost *:80>
<Directory /var/www/webchatsed.org/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
ServerAdmin admin@webchatsed.org
ServerName webchatsed.org
ServerAlias www.webchatsed.org
DocumentRoot /var/www/webchatsed.org/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
$ sudo a2ensite webchatsed.org.conf
$ sudo service apache2 restart
The final step is to add the rules to connect from the computers to the server
$ sudo nano /etc/hosts
Add this two lines in the hosts file
127.0.0.1 webchatsed.org
127.0.0.1 www.webchatsed.org
Now that you have your virtual hosts configured, you can test your setup easily by going to the domain, you still have to run the server
http://webchatsed.org
cd /var/www/webchatsed.org/public
php5.6 src/chat-server.php