This document provides detailed instructions for deploying the Chess project and setting up the PHP WebSocket server.
Before you begin, ensure you have the following:
Clone the Chess project repository to your local machine:
git clone https://github.com/Osalotioman/Chess.git
Navigate to the project directory:
cd Chess
Use Composer to install the required dependencies for the PHP WebSocket server:
composer install
If you are using Apache, create a virtual host configuration for the Chess project. Add the following configuration to your Apache configuration file (e.g., httpd.conf or apache2.conf):
<VirtualHost *:80>
ServerName chess.local
DocumentRoot /path/to/Chess/html
<Directory /path/to/Chess/html>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/chess_error.log
CustomLog ${APACHE_LOG_DIR}/chess_access.log combined
</VirtualHost>
If you are using Nginx, create a server block configuration for the Chess project. Add the following configuration to your Nginx configuration file (e.g., nginx.conf or sites-available/default):
server {
listen 80;
server_name chess.local;
root /path/to/Chess/html;
index index.html;
location / {
try_files $uri $uri/ =404;
}
error_log /var/log/nginx/chess_error.log;
access_log /var/log/nginx/chess_access.log;
}
Update your hosts file to map the chess.local domain to localhost. Add the following line to your hosts file:
127.0.0.1 chess.local
Start your web server to serve the Chess project. For Apache, use the following command:
sudo service apache2 restart
For Nginx, use the following command:
sudo service nginx restart
Navigate to the server directory and start the PHP WebSocket server using Composer:
cd server
composer start
Open your browser and navigate to:
http://chess.local
You should now be able to play the Chess game locally.
If you encounter any issues during deployment, check the following:
For further assistance, feel free to reach out to the project maintainers.
Happy playing!