Hosting a website
How your site is served
Your website runs nginx, a web server, with PHP behind it. It is reachable at your free address,
such as yoursite.pulsedmc.net, over HTTPS. The certificate is handled for you, so
you don't need to set up SSL yourself.
It works like your other servers in the panel. You can start and stop it, see its logs in the Console, edit files in the File Manager, and make backups. When the site is stopped, visitors see a short "this site is offline" page.
Where your files go
Everything visitors can see lives in the www folder. Whatever is in
www/index.html or www/index.php is your home page. A file at
www/about.html is at yoursite.pulsedmc.net/about.html.
To put a site up, open the File Manager, go into www,
delete the sample page, and upload your files. You can upload a .zip and unarchive
it in the file manager, which is much faster than many single files.
For regular updates, connect over SFTP with FileZilla, WinSCP or your code editor. The address, port and username are on the Settings tab, and the password is your panel password.
Anything in www can be downloaded by anyone who guesses its name. Put
configuration with passwords one folder up, outside www, and load it from your
PHP code.
PHP versions
Your site runs the PHP version you picked when you ordered. To change it, open the Startup tab and change two things to match:
- The Docker Image, for example the
8.4image. - The PHP Version setting, to the same number, for example
8.4.
Restart the site afterwards. If the two don't match, PHP fails to start and the console says so. Most current software, such as Laravel and modern CMSs, wants 8.2 or newer.
Deploy from Git
If your site is in a Git repository, the server can pull it for you. On the Startup tab:
- Set Enable Git Module to
1. - Set the Git Repo Address and, if needed, the Git Branch.
- For a private repository, set your Git Username and a Git Access Token with read access. Never use your account password.
- Restart. The server pulls the latest code on every start.
If your project uses Composer, set Enable Composer Module to 1 and list the packages in Composer Packages, or
include a composer.json in your repository.
Pretty URLs and the nginx config
Many PHP apps want every request sent to index.php, so links like
/blog/my-post work. That is set in the nginx config at
nginx/conf.d/default.conf. Find the location / block and make its
try_files line look like this:
location / {
try_files $uri $uri/ /index.php?$query_string;
}
Restart the site after editing. If nginx doesn't come back, the console shows the line it didn't like. Fix it or undo the change.
The listen line at the top of that file is set to your server's port on every
start. If you change it, your site stops being reachable at your address.
Scheduled jobs
To run something on a timer, such as a cleanup script, set Enable Cron Module to 1 on the
Startup tab and add your jobs to the crontab file in the
main folder. It uses the normal cron format:
# every day at 4:00 0 4 * * * php /home/container/www/cleanup.php
Leave Enable Certbot SSL and Enable Cloudflare Tunnel off. HTTPS for your address is already handled for you, and turning those on can stop the site starting.
Troubleshooting
I uploaded my site but still see the old page
Check the files are inside www and not in a folder within it, which is
common after unzipping. Then refresh with Ctrl+F5 to skip your browser's cache.
I get "This site is offline"
The site is stopped or still starting. Start it from the panel and wait for the console to show the services launched. If it stops again, the last console lines say why.
Can I use WordPress or a MySQL database?
Plans don't include a MySQL database yet, so WordPress isn't available. Sites that don't need one, or that use SQLite, work today.