SpaceCore WIKI
English
English
  • Personal Account and Registration
    • Account registration
    • «Customer» section
    • «Finance» section
    • Account Verification (KYC)
  • Customer service
    • How do I place an order?
    • How to contact support?
    • The Game Hosting panel
    • Setting Up BILLmanager 6 for Reselling
  • Communications
    • Notifications in Telegram
    • Web Hosting Notifications
    • Using a ping bot in Telegram
  • Information board
    • Blocked ports (VPS/VDS)
    • What is IOPS?
    • VAT for the EU and UK
  • VPS and Dedicated Servers
    • How to use VPS/VDS?
    • Changing the Password for VDS
  • OS and software configuration
    • Java [Linux]
    • Screen
    • Linux Password Recovery
    • Connecting via SSH keys
    • Disabling access to Linux using a password
    • Deploying MikroTik RouterOS on VDS
  • AI
    • Deploying DeepSeek on your server in just a few clicks
  • Windows
    • RDP connection
    • Configuring the RDP connection
    • Changing the password
    • Installation via QEMU
    • How to add an IPv4
    • Download files
    • Bruteforce Windows
  • Network Setup and Security
    • No interaction with private networks
    • Working with TCPDump
    • Change MTU Value
    • Configure IPTables
    • [DNS] Temporary failure resolving...
    • Network Speed Measurement [SpeedTest]
    • How do I buy a domain name?
    • How do I direct my domain to an IP address?
    • How to Protect Your Server? Basics of Cybersecurity
  • VPN and Privacy
    • WireGuard VPN [Easy]
    • OpenVPN [Easy]
    • Outline VPN Installation
    • Installing TorrServer
    • Installing 3X UI
    • Installing Marzban
    • Proxy for Specific Websites (V2RayN)
    • Use Nekoray
  • System monitoring
    • Traffic monitoring via VnStat
    • How to use the MTR tool
    • Getting Serial Numbers of Drives
  • Administration and Backups
    • Working with FTP Repository
    • Auto-shipment of backups
    • Installing an FTP Server
    • Mounting Linux Drives
  • Web development
    • Installing Apache2
    • Installing Nginx
    • Installing PHP
    • Installing MySQL
    • Installing PhpMyAdmin
    • Let's Encrypt SSL Generation
  • Minecraft
    • Installing Minecraft Java Server
    • Installing the Minecraft Bedrock/PE server
    • Installing the BungeeCord server
    • Installing Sponge Forge 1.12.2 Kernel
    • Configuring server.properties
    • Installing the icon on the server
    • Launch Options
    • Installing a resource pack on the server
  • Hetzner Servers
    • Control Panel
    • Password change via Rescue
    • Installing the operating system
  • 🇩🇪Contabo
    • The Control Panel
    • Disk space expansion
Powered by GitBook
On this page
  • Installation Apache2:
  • Customization Apache2:
  • Connecting PHP to Apache2:
  • Enabling rewrite:
  • Enabling SSL:
  • Check на nginx:
  • Removal Apache2

Apache is a cross-platform software that supports Linux, BSD, Mac OS, Microsoft Windows, Novell NetWare, and BeOS operating systems.

Installation Apache2:

To install Apache2 on VDS, you must register:

apt-get install apache2

Customization Apache2:

To configure Apache2, go to /etc/apache2/sites-available and create a file modeled on site.conf:

<VirtualHost *:80>
        ServerName spacecore.pro # Specify the site domain
        ServerAdmin admin@spacecore.pro # Your email address
        DocumentRoot /var/www/html # The path to the site folder

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Turning on the site, the site.conf location should be the name of the config that you created:

a2ensite site.conf

If you need to disable the site, the name of the config should be instead of site.conf:

a2dissite site.conf

Rebooting apache2:

service apache2 reload

Connecting PHP to Apache2:

In order for Apache to display php files correctly, you need to install the package:

apt-get install libapache2-mod-php -y

Rebooting apache2:

service apache2 reload

Enabling rewrite:

Without this option, 70% of CMS for websites will not work.

Most sites contain a file.htaccess must be registered for its operation:

a2enmod rewrite

Rebooting apache2:

service apache2 reload

Enabling SSL:

SSL connection is not required, it is carried out if it is available and you wish.

You need to enable the module that is responsible for SSL:

a2enmod ssl

Creating another config in /etc/apache2/sites-available, it will be responsible for SSL, for example site-ssl.conf:

site-ssl.conf
<VirtualHost *:443>
        ServerName spacecore.pro # Specify the site domain
        ServerAdmin admin@spacecore.pro # Your email address
        DocumentRoot /var/www/html # The path to the site folder
        
        SSLEngine on
        SSLCertificateFile /path/to/your_domain_name.pem # The path to the public certificate
        SSLCertificateKeyFile /path/to/your_private.key # The path to the private certificate

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Rebooting apache2:

service apache2 reload

Check на nginx:

If apache2 is installed with nginx, then they will conflict due to port - 80. So you need to delete one of the web servers. Check if nginx is installed:

service nginx status

If a huge message with information is not visible, then it is not installed.

If nginx is installed, you need to delete it:

apt-get remove --purge nginx* -y

Removal Apache2

To remove Apache2, use:

apt-get remove --purge apache2* -y
PreviousMounting Linux DrivesNextInstalling Nginx

Last updated 12 months ago