This documentation provides a comprehensive guide for setting up a web hosting environment using CentOS Web Panel (CWP7) on AlmaLinux 9. CWP is a free web hosting control panel designed as an alternative to cPanel that provides a graphical interface for managing web hosting services.
This documentation covers all aspects of the setup process, including VPS preparation, CWP installation, website management, domain configuration, and security implementation. By following this guide, you will be able to set up a fully functional web hosting environment that meets all the requirements specified in the assessment.
Note: Throughout this documentation, we'll be using the hostname group4.tendotech.co.uk as our primary domain. All commands should be executed as the root user unless otherwise specified.
2. VPS Setup and Preparation
2.1 System Requirements
Before installing CWP7, ensure your VPS meets the following minimum requirements:
AlmaLinux 9 (fresh installation recommended)
Minimum 2GB RAM (4GB recommended)
Minimum 20GB disk space
At least 1 CPU core
Static IP address
Root access
2.2 Initial Server Setup
Update your AlmaLinux 9 system to ensure all packages are up to date:
dnf update -y
Install necessary utilities:
dnf install -y wget nano curl net-tools
2.3 Disable SELinux
CWP recommends disabling SELinux to avoid conflicts. Edit the SELinux configuration file:
nano /etc/selinux/config
Change the SELINUX value to disabled:
SELINUX=disabled
To temporarily disable SELinux without rebooting, run:
setenforce 0
2.4 Configure Hostname and Networking
Set the hostname for your server to our designated domain:
hostnamectl set-hostname group4.tendotech.co.uk
Update the hosts file to include your server's IP address and hostname:
nano /etc/hosts
Add the following line (replace with your actual IP):
192.168.1.100 group4.tendotech.co.uk group4
Note: It's important to have proper reverse DNS setup for your server's IP address, as this is crucial for email delivery. Ensure your domain group4.tendotech.co.uk is properly configured in DNS.
3. CWP7 Installation on AlmaLinux 9
3.1 Download and Run the CWP7 Installer
Download the CWP7 installation script:
cd /usr/local/src
wget http://centos-webpanel.com/cwp-el9-latest
Make the script executable and run it:
chmod +x cwp-el9-latest
./cwp-el9-latest
The installation process will take approximately 15-30 minutes depending on your server's specifications. The installer will automatically set up all the necessary services including:
Apache Web Server
MySQL/MariaDB Database Server
PHP and PHP-FPM
Postfix Mail Server
Dovecot POP3/IMAP Server
ProFTPD FTP Server
Bind DNS Server
CWP User Interface
Warning: Do not interrupt the installation process as it may cause incomplete installation and system inconsistencies.
3.2 Post-Installation Access
After the installation completes, you'll see a success message with important information:
CWP admin panel URL (typically http://group4.tendotech.co.uk:2030/ or https://group4.tendotech.co.uk:2031/)
Default admin username and password
MySQL root password
Save this information securely as you'll need it to access the control panel.
Note: Make sure to save the MySQL root password shown at the end of the installation. This is a randomly generated password and will be needed for database management.
3.3 Initial Login
Access the CWP admin panel using your web browser:
http://group4.tendotech.co.uk:2030/
Login with the credentials provided at the end of the installation process. On first login, you'll be prompted to change your password for security reasons.
4. CWP7 Configuration
4.1 Initial Setup Wizard
After your first login, complete the setup wizard to configure basic settings:
Verify system settings
Configure server hostname as group4.tendotech.co.uk
Set up nameservers (if you're using the server as a DNS server)
Configure mail server settings
4.2 Server Settings Configuration
Navigate to "Server Settings" in the CWP panel to configure various aspects of your server:
PHP Configuration: Set up different PHP versions and adjust PHP settings
Apache Configuration: Adjust Apache settings for optimal performance
MySQL Configuration: Optimize MySQL for your server's resources
DNS Settings: Configure DNS server settings if you're hosting domains
Mail Server Settings: Configure Postfix and Dovecot settings
4.3 PHP Configuration
CWP7 supports multiple PHP versions. To configure PHP:
Go to "PHP Settings" in the CWP panel
Select the PHP versions you want to install (recommended: PHP 7.4, 8.0, and 8.1)
Configure PHP settings for each version (memory_limit, max_execution_time, etc.)
Enable/disable PHP extensions as needed
Example of recommended PHP settings for a 4GB RAM server:
Configure Apache settings to optimize performance:
Go to "Apache Settings" in the CWP panel
Adjust the following settings based on your server resources:
MaxKeepAliveRequests
KeepAliveTimeout
MaxClients/MaxRequestWorkers
StartServers, MinSpareServers, MaxSpareServers
Enable/disable Apache modules as needed
Apply changes and restart Apache
4.5 MySQL/MariaDB Configuration
Optimize MySQL for your server:
Go to "MySQL Settings" in the CWP panel
Adjust the following key settings:
innodb_buffer_pool_size (50-70% of RAM for a dedicated DB server)
max_connections
query_cache_size
tmp_table_size and max_heap_table_size
Apply changes and restart MySQL
Note: MySQL configuration heavily depends on your server's specifications and usage patterns. Monitor server performance and adjust settings accordingly.
5. Website and Account Setup
5.1 Creating User Accounts
For each group member, you need to create at least three websites/accounts. Here's how to create a new account:
Login to the CWP admin panel
Navigate to "Account Functions" > "Create Account"
Fill in the account details:
Domain name (e.g., user1.group4.tendotech.co.uk)
Username (automatically generated based on domain)
Password (use a strong password)
Email address
Package/Plan (select appropriate resource limits)
Configure additional options:
PHP version
Database settings
Email accounts
FTP access
Click "Create" to create the account
5.2 Creating Packages (Resource Plans)
Before creating accounts, it's a good practice to set up packages that define resource limits:
Go to "Account Functions" > "Packages"
Click "Add Package"
Configure package limits:
Disk space
Bandwidth
Email accounts
FTP accounts
MySQL databases
Subdomains and addon domains
Save the package
5.3 Setting Up Websites
After creating an account, you can set up the website content:
Login to the user's CWP User panel (usually at http://group4.tendotech.co.uk:2082/)
Navigate to the File Manager or use FTP to upload website files
For a quick test site, create an index.html file in the public_html directory
For CMS installation (e.g., WordPress, Joomla), you can use the Softaculous auto-installer in the CWP User panel
5.4 Installing WordPress via Softaculous (Example)
An easy way to set up a website is using Softaculous to install a CMS:
Login to the user's CWP User panel
Navigate to "Softaculous" in the sidebar
Select "WordPress" from the available applications
Click "Install Now" and fill in the required information:
Installation URL (typically the domain name)
Site name and description
Admin username, password, and email
Select theme and plugins
Click "Install" to complete the WordPress installation
5.5 Setting Up Email Accounts
To create email accounts for users:
Login to the CWP User panel
Navigate to "Email Accounts"
Click "Create Email Account"
Enter the email address details (e.g., info@user1.group4.tendotech.co.uk)
Set password and mailbox quota
Click "Create" to set up the email account
Repeat this process for each group member, creating at least three websites/accounts per person.
Note: Keep track of all account credentials in a secure location. You'll need these for documentation and final presentation.
6. Domain Configuration (DNS and SSL)
6.1 DNS Configuration
Configure DNS settings for your domains:
To manage DNS settings in CWP, go to "DNS Functions" > "Add/Remove DNS Zone"
For a new domain, the DNS zone is automatically created when you create an account
To edit DNS records, go to "DNS Functions" > "Edit DNS Zone"
Select the domain you want to edit (e.g., group4.tendotech.co.uk)
Add or modify the following records as needed:
A records (for IPv4 addresses)
AAAA records (for IPv6 addresses)
CNAME records (for aliases)
MX records (for mail servers)
TXT records (for SPF, DKIM, etc.)
Save changes to update the DNS zone
Example of basic DNS records for our domain:
; A Records
group4.tendotech.co.uk. IN A 192.168.1.100
www.group4.tendotech.co.uk. IN A 192.168.1.100
mail.group4.tendotech.co.uk. IN A 192.168.1.100
; MX Records
group4.tendotech.co.uk. IN MX 10 mail.group4.tendotech.co.uk.
; CNAME Records
webmail.group4.tendotech.co.uk. IN CNAME mail.group4.tendotech.co.uk.
cpanel.group4.tendotech.co.uk. IN CNAME group4.tendotech.co.uk.
; TXT Records
group4.tendotech.co.uk. IN TXT "v=spf1 mx a ip4:192.168.1.100 ~all"
6.2 SSL Certificates with Let's Encrypt
Secure your domains with free SSL certificates from Let's Encrypt:
In the CWP admin panel, go to "SSL Certificates" > "Let's Encrypt SSL"
Select the domain you want to secure (e.g., group4.tendotech.co.uk)
Choose whether to include www subdomain
Click "Issue/Renew Certificate"
CWP will automatically obtain and install the SSL certificate
Once installed, configure the website to force HTTPS by editing the virtual host file or using the CWP panel
6.3 Manual SSL Certificate Installation
If you need to install a custom SSL certificate:
Go to "SSL Certificates" > "Install SSL"
Select the domain
Paste your certificate, private key, and CA bundle in the appropriate fields
Click "Install Certificate"
6.4 Configuring SSL in Apache
After installing SSL certificates, ensure Apache is properly configured:
Go to "Server Settings" > "Apache Settings"
Make sure mod_ssl is enabled
Configure SSL ciphers and protocols for security:
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite HIGH:!aNULL:!MD5:!3DES
SSLHonorCipherOrder on
Save changes and restart Apache
6.5 Redirect HTTP to HTTPS
Force all traffic to use HTTPS by adding the following to the virtual host configuration:
<VirtualHost *:80>
ServerName group4.tendotech.co.uk
ServerAlias www.group4.tendotech.co.uk
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</VirtualHost>
You can edit these settings through "Apache Settings" > "Edit Virtual Host" in the CWP panel.
Note: For Let's Encrypt SSL to work properly, your domain must be publicly accessible and resolving to your server's IP address.
7. FTP Server Configuration
7.1 ProFTPD Configuration
CWP7 uses ProFTPD for FTP services. To configure ProFTPD:
In the CWP admin panel, go to "Service Manager" > "Settings" > "FTP Server"
Configure the following settings:
FTP Port (default is 21)
Passive Port Range (e.g., 30000-50000)
Maximum Clients
Timeout settings
Save changes and restart the FTP service
7.2 Securing FTP with SSL/TLS (FTPS)
For enhanced security, configure ProFTPD to use SSL/TLS:
Go to "Service Manager" > "Settings" > "FTP Server"
Enable SSL/TLS support
Specify the SSL certificate and key files
Configure TLS requirements (e.g., require TLS for data transfers)
Save changes and restart the FTP service
Example ProFTPD SSL/TLS configuration:
<IfModule mod_tls.c>
TLSEngine on
TLSLog /var/log/proftpd/tls.log
TLSProtocol TLSv1.2
TLSRSACertificateFile /etc/pki/tls/certs/proftpd.crt
TLSRSACertificateKeyFile /etc/pki/tls/private/proftpd.key
TLSOptions NoCertRequest
TLSVerifyClient off
TLSRequired on
</IfModule>
7.3 Creating FTP Accounts
Create FTP accounts for users to access their website files:
In the CWP User panel, go to "FTP Accounts"
Click "Add FTP Account"
Enter username and password
Set the directory path (starting point for the FTP user)
Go to "Service Manager" > "Settings" > "Anti-Spam"
Enable SpamAssassin
Configure spam score thresholds
Set up spam actions (mark, reject, or quarantine)
Configure RBL (Realtime Blackhole List) settings
Save changes and restart SpamAssassin
8.5 Email Delivery and Authentication Records
Configure DNS records for proper email delivery and authentication:
Set up SPF records to specify authorized mail servers:
group4.tendotech.co.uk. IN TXT "v=spf1 mx a ip4:your-server-ip ~all"
Configure DKIM (DomainKeys Identified Mail):
Go to "Service Manager" > "Settings" > "DKIM"
Generate DKIM keys for your domains
Add the resulting TXT records to your DNS configuration
Set up DMARC (Domain-based Message Authentication, Reporting & Conformance):
_dmarc.group4.tendotech.co.uk. IN TXT "v=DMARC1; p=none; rua=mailto:admin@group4.tendotech.co.uk"
Note: Proper email server configuration is crucial for email deliverability. Misconfigured email servers may have their messages marked as spam or rejected by receiving servers.
9. Security Implementation
9.1 Firewall Configuration
Configure firewall rules to secure your server:
In the CWP admin panel, go to "Security" > "Firewall"
# Set to "security" for only security updates
upgrade_type = security
# Set to "yes" to auto-download and install
download_updates = yes
apply_updates = yes
systemctl enable --now dnf-automatic.timer
Regularly update CWP:
In the CWP admin panel, go to "CWP Updates"
Check for and install available updates
Monitor security mailing lists for vulnerabilities affecting your software
9.6 File Permissions
Secure file permissions to prevent unauthorized access:
Set secure permissions for web directories and files:
# For directories
find /home/username/public_html -type d -exec chmod 755 {} \;
# For files
find /home/username/public_html -type f -exec chmod 644 {} \;
Secure configuration files:
chmod 600 /home/username/public_html/wp-config.php # Example for WordPress
Warning: Security is an ongoing process. Regularly audit your server for vulnerabilities, review logs for suspicious activities, and keep all software up to date.
10. Troubleshooting Strategies
10.1 Common Issues and Solutions
Here are some common issues you might encounter and their solutions:
Website Not Loading
Check Apache status:
systemctl status httpd
Verify virtual host configuration
Check file permissions in the web directory
Review Apache error logs:
tail -f /var/log/httpd/error_log
Ensure domain is properly pointing to your server
Email Delivery Issues
Check Postfix status:
systemctl status postfix
Verify mail server configuration
Check mail logs:
tail -f /var/log/maillog
Verify DNS records (MX, SPF, DKIM, DMARC)
Test email delivery:
echo "Subject: Test Email" | sendmail admin@group4.tendotech.co.uk
Database Connection Issues
Check MySQL/MariaDB status:
systemctl status mariadb
Verify database credentials in website configuration
Implement backup strategies for disaster recovery:
Configure regular backups in CWP:
Go to "Backup/Restore" > "Setup Backup"
Configure backup frequency and retention
Select backup destinations (local, remote FTP, or cloud)
Choose what to backup (website files, databases, email)
Test backup restoration:
Go to "Backup/Restore" > "Restore Backup"
Select a backup to restore
Choose restoration options
Perform the restoration
Document the backup and recovery procedures
10.4 Performance Optimization
Optimize server performance to prevent issues:
Monitor server resources using CWP's monitoring tools
Optimize PHP settings:
Enable PHP opcode caching
Adjust memory limits based on usage
Configure PHP-FPM for better performance
Optimize MySQL/MariaDB:
Enable query caching
Optimize buffer sizes based on available memory
Use the MySQLTuner script for recommendations
Implement web caching:
Enable Apache mod_cache
Set up Varnish or Redis for advanced caching
Configure browser caching through .htaccess
Note: Document all troubleshooting procedures and solutions for future reference and knowledge sharing within your team.
11. Final Presentation Guidelines
The final presentation will be conducted during Week 14 (April 21-27, 2025). This section details what should be covered in the presentation and how to prepare for it.
11.1 Demonstrating Operational VPS and WHM Setup
Be prepared to demonstrate the following aspects of your operational VPS and WHM setup:
Server Status and Resource Monitoring
Show server uptime and resource usage (CPU, RAM, disk)
Demonstrate CWP's server monitoring tools
Display network traffic and connection statistics
Show running services and their status
CWP Admin Panel Features
Navigate through key areas of the admin panel
Demonstrate user management capabilities
Show server configuration options
Explain customizations made to the default setup
User Management Demonstration
Create a new user account live during the presentation
Show how to modify user permissions and resource limits
Access and demonstrate the user control panel features
11.2 Hosted Websites and Security Implementations
Demonstrate the websites you've set up and their security features:
Website Showcase
Show at least three functioning websites for each group member
Demonstrate different types of websites (static HTML, CMS-based, etc.)
Access websites through domain names with proper SSL certificates
Show mobile-responsive capabilities if implemented
Security Features Demonstration
Show SSL certificate implementation and explain the setup process
Demonstrate firewall settings and explain protection mechanisms
Show ModSecurity configuration and explain rule sets
Display Fail2ban logs or configuration to show brute force protection
Demonstrate file permission security measures
User Authentication and Access Control
Show secure FTP connections using SSL/TLS
Demonstrate email account security features
Show SSH access security implementations
Explain password policies and authentication measures
11.3 Troubleshooting Strategies for Outages
Present comprehensive troubleshooting strategies for various potential outages:
Server Downtime Scenarios
Explain step-by-step procedures for diagnosing server crashes
Show how to identify resource exhaustion issues (CPU, RAM, disk space)
Demonstrate using system logs to diagnose problems
Outline recovery procedures and service restart protocols
Website Availability Issues
Show how to diagnose and fix Apache/web server problems
Demonstrate diagnosing PHP configuration issues
Explain procedures for resolving database connectivity problems
Show how to troubleshoot DNS configuration issues
Security Incident Response
Present a plan for identifying and responding to security breaches
Show how to analyze access logs for suspicious activity
Demonstrate using CWP security tools to identify compromised accounts
Explain data recovery procedures in case of malicious attacks
Proactive Monitoring and Prevention
Show automated monitoring solutions implemented
Demonstrate alert systems for critical service failures
Explain backup and restoration procedures
Present documentation for regular maintenance tasks
11.4 Presentation Tips and Requirements
To ensure a successful presentation, consider the following guidelines:
Prepare a structured presentation with clear sections following the outline above
Each group member should participate in the presentation
Include both slides for theoretical explanation and live demonstrations
Prepare for potential technical difficulties during live demonstrations
Have screenshots ready as backups in case live demonstrations encounter issues
Prepare to answer technical questions about your implementation
Practice the presentation to ensure it fits within the allocated time
Be prepared to show specific code or configuration files if requested
Note: The final presentation is an opportunity to showcase not just the technical implementation but also your understanding of web hosting concepts and security best practices. Be prepared to explain not just what you did, but why you made specific configuration choices.
12. Conclusion
This documentation provides a comprehensive guide for setting up a web hosting environment using CWP7 on AlmaLinux 9. By following the steps outlined in this document, you have successfully:
Installed and configured CWP7 on AlmaLinux 9
Set up multiple websites and user accounts
Configured domain names, DNS settings, and SSL certificates
Implemented FTP and SMTP server configurations
Secured the web server with firewalls, authentication controls, and encryption
Created a robust troubleshooting strategy for potential issues
The setup you've created provides a secure, reliable, and functional web hosting environment suitable for hosting multiple websites. The documentation covers all the requirements specified in the assessment and provides additional information for maintenance and troubleshooting.
For the final presentation, be prepared to demonstrate:
The operational VPS and CWP setup
The hosted websites and their security implementations
Troubleshooting strategies for potential outages
Remember to keep your server updated and regularly review security measures to maintain a secure and optimal hosting environment.
13. Glossary of Technical Terms
This section explains the technical terms and abbreviations used throughout this documentation:
Server and Administration Terms
VPS (Virtual Private Server): A virtualized server that mimics a dedicated physical server, providing dedicated resources and full root access within a shared hosting environment.
WHM (Web Host Manager): A web-based interface used by server administrators to manage web hosting accounts, server settings, and various hosting services.
CWP (CentOS Web Panel): A free web hosting control panel for Linux servers that provides a graphical interface to manage websites, email, DNS, and other services.
AlmaLinux: A free, open-source Linux distribution that is binary compatible with Red Hat Enterprise Linux, created as an alternative to CentOS.
FQDN (Fully Qualified Domain Name): A domain name that specifies the exact location in the DNS hierarchy, including all domain levels (e.g., group4.tendotech.co.uk).
Security Terms
SSL (Secure Sockets Layer): A protocol for establishing encrypted links between a web server and a browser, ensuring that all data transmitted remains private and secure.
TLS (Transport Layer Security): The successor to SSL, providing communication security over a computer network, commonly used to secure web browsing, email, and other data transfers.
HTTPS (Hypertext Transfer Protocol Secure): An extension of HTTP that uses SSL/TLS for secure communication over a computer network.
Firewall: A network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules.
CSF (ConfigServer Firewall): A stateful packet inspection firewall, login/intrusion detection, and security application for Linux servers.
ModSecurity: An open-source web application firewall (WAF) that provides protection against various web-based attacks.
Fail2ban: A software that scans log files and bans IP addresses showing malicious signs such as too many failed login attempts.
Web and Database Terms
Apache: A popular open-source web server software that processes requests and serves web content over HTTP.
MySQL/MariaDB: Popular open-source relational database management systems used for storing and managing website data.
PHP: A server-side scripting language designed for web development that can be embedded into HTML.
PHP-FPM (PHP FastCGI Process Manager): An alternative PHP FastCGI implementation with additional features useful for high-load websites.
CMS (Content Management System): Software applications that allow users to create, manage, and modify website content without specialized technical knowledge.
Communication and Protocol Terms
SSH (Secure Shell): A cryptographic network protocol for secure operation of network services over an unsecured network, commonly used for remote server access and administration.
FTP (File Transfer Protocol): A standard network protocol used for transferring files between a client and server on a computer network.
FTPS (FTP Secure): An extension to FTP that adds support for TLS and SSL cryptographic protocols.
SMTP (Simple Mail Transfer Protocol): A communication protocol for electronic mail transmission, used for sending email messages between servers.
POP3 (Post Office Protocol version 3): A standard protocol used by email clients to retrieve email from a mail server.
IMAP (Internet Message Access Protocol): A protocol for email retrieval that allows multiple clients to access messages on a mail server.
DNS and Domain Terms
DNS (Domain Name System): A hierarchical and decentralized naming system for computers, services, or other resources connected to the Internet or a private network.
A Record: A DNS record that maps a domain name to the IP address of the server hosting the domain.
CNAME Record: A DNS record that maps an alias name to another domain name (the canonical name).
MX Record: A DNS record that specifies mail servers responsible for accepting email messages on behalf of a domain.
SPF (Sender Policy Framework): An email authentication method designed to detect email spoofing by providing a mechanism to verify that email messages come from authorized sending sources.
DKIM (DomainKeys Identified Mail): An email authentication method designed to detect email spoofing by providing digital signatures linked to the domain name of an email sender.
DMARC (Domain-based Message Authentication, Reporting, and Conformance): An email authentication protocol that builds on SPF and DKIM to improve protection against email spoofing and phishing.
Email and Authentication Terms
Postfix: A free and open-source mail transfer agent (MTA) that routes and delivers email.
Dovecot: An open-source IMAP and POP3 server for Linux/UNIX-like systems, primarily written with security in mind.
SASL (Simple Authentication and Security Layer): A framework for authentication and data security in Internet protocols.
SpamAssassin: An open-source anti-spam platform that uses various techniques to identify and filter spam.
RBL (Realtime Blackhole List): A list of IP addresses published through the DNS, used to publish the addresses of known spammers or spam sources.