Bobcares

CyberPanel vHost Conf | How to Modify

by | Apr 8, 2024

Learn how to modify CyberPanel vHost Conf. Our CyberPanel Support team is here to help you with your questions and concerns.

CyberPanel vHost Conf | How to Modify 

Are you ready to host your Django website on a CyberPanel VPS?

CyberPanel vHost Conf | How to Modify 

Congratulations! However, before you can start enjoying the benefits of having your website live on the internet, there are a few steps you need to take to ensure everything runs smoothly.

Setting Up Your Virtual Host Template

When we create a new account on CyberPanel, one of the first things we have to do is set which virtual host template that account is copied from.

By default, CyberPanel uses the template located in /usr/local/CyberCP/plogical/vhostConfs.py.

However, we can customize this template or use a different one with these steps:

  1. To begin with, log in to the CyberPanel server.
  2. Then, go to the openlitespeed admin page (usually accessible at 7080).
  3. Now, head to Virtual Hosts and add a new vhost.
  4. At this point, we have to fill in details, like the Virtual Host Name, Virtual Host Root, and Config File.
  5. Then, make sure that the “Follow Symbolic Link,” “Enable Scripts,” and “Restrained” options are all set to yes.
  6. Now, add the vhost, and go to the General tab. Then edit the document root and domain name as needed.
  7. Save the changes and do a graceful restart.
  8. Then, head to to Listeners, click on the view icon from the Default, port 80 line, and add a new Virtual Host Mapping.
  9. Finally, do a graceful restart of LSWS to apply the changes.

Updating Environment Variables

To make sure that our Django website runs smoothly on CyberPanel, we have to update some environment variables.

Specifically, if you run into issues with the LS_PYTHONBIN or PYTHONPATH variables, here are the steps to correct them:

  1. Log in to CyberPanel server via SSH or the web interface.
  2. Then, open the website manager and locate the desired website.
  3. Next, go to the vHost configuration (vHost Conf) and find the “context” block.
  4. Now, add or update the necessary environment variables, such as LS_PYTHONBIN and PYTHONPATH.
  5. Finally, save the changes and restart LSWS to apply the updates.

With these steps, we will be able to host our Django website successfully on a CyberPanel VPS. Remember to regularly monitor the site for any issues and make updates as needed for optimal performance.

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

In brief, our Support Experts demonstrated how to modify CyberPanelvHost Conf.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.