• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System BSD

Creating a Simple Website on Vultr With OpenBSD and httpd

How VPS by How VPS
September 1, 2019
in BSD
0
0
SHARES
77
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Introduction
  2. Creating the Instance
  3. Update DNS Records
  4. Logging into the Server over SSH as root
  5. Logging into the Server over SSH with your new username
  6. Creating a directory for your Website
  7. Configuring httpd
  8. Checking the configuration settings and starting httpd
  9. Creating a simple Webpage
  10. Want to contribute?


Introduction

The purpose of this guide is to show you how easy it is to make a homepage for your website on Vultr with OpenBSD and httpd.

Creating the Instance

Head over to https://my.vultr.com/deploy/. This is the main page for deploying new servers. However, before installing anything on your server, we must first create it. Thankfully, Vultr has made this process very easy:

  1. Choose where you would like the server to be located at.
  2. Select “64bit” and then “OpenBSD“.
  3. Select the desired hardware specifications for the new instance.
  4. Select any additional features you need.
  5. If you have any startup scripts place them here.
  6. Create and add your SSH key. (See this guide)
  7. Finally enter the Hostname and Label for the server. For this guide, we will use My-Website-01.

After checking the summary at the bottom of the page and making sure everything is correct, click the Deploy Now button. Allow a minute or two for the server to be created. Afterwards you will be redirected to a new page that shows the status of all your servers.

Once the status tab turns green on the newly created server, everything is up and running. Click the manage link next to it and you will be taken to the server information page. You will see Server Information (My-Website-01) at the top of the page. From here you can manage the server and view the root password by clicking the eye icon.

Update DNS Records

Next you should record the IP address assigned to your server and point your DNS records at it. You can read more about how to do this here.

Logging into the Server over SSH as root

Open up your SSH program and connect to your server as root. Please note that this is heavily frowned upon so we will only be doing this once in order to create a non-root user with elevated privileges. Once you have connected to your server over SSH, make an account for yourself. To do this enter adduser into the terminal. You will now be prompted with several questions about the new account. The only two things you are required fill out are your username and password. The rest of the questions are optional.

After making the account, the final thing that must be done is enabling elevated privileges for it. While you are still logged in as root, enter the following into the terminal:

user mod -G wheel username

This will place your account in the wheel group, allowing you to act as root.

Logging into the Server over SSH with your new username

We are now finished with creating your account. Exit the server and reconnect with your new account. The first thing you should do is enter su into the terminal. You will be asked the password for the root account.

Creating a directory for your Website

Now we need to make a directory for your website:

mkdir -p /var/www/htdocs/yourwebsite.com

Configuring httpd

Let’s make the configuration file:

vi /etc/httpd.conf

Type the following into the file:

# Main Configuration
server "yourwebsite.com" {
    listen on * port 80
    root "/htdocs/yourwebsite.com"
}

# This is a redirect to the Main Configuration
server "www.yourwebsite.com" {
    listen on * port 80
    block return 301 "http://yourwebsite.com$REQUEST_URI"
}

Save and exit.

Checking the configuration settings and starting httpd

Go ahead and make sure everything is working:

httpd -n

You will see httpd(ok). This indicates that everything is working.

The final two things we need to do for httpd is enable it, and then start it.

Enable httpd:

rcctl enable httpd

Start httpd:

rcctl start httpd

You will now be able to access your website over the internet, however you will get a 403 status code because there’s nothing in the website directory. Let’s change that.

Creating a simple Webpage

Create your homepage by typing the following:

vi /var/www/htdocs/yourwebsite.com/index.html

Populate it with the following:

<!DOCTYPE html>
<html>
    <head>
        <title>Hello World</title>
    </head>

    <body>
        <p>Welcome to my OpenBSD server on Vultr!</p>
    </body>
</html>

Save and exit, and you have successfully created your first website on OpenBSD.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install Monica on FreeBSD 12

Next Post

How to Install Osclass on FreeBSD 12

Next Post

How to Install Osclass on FreeBSD 12

Leave a Reply Cancel reply

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

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet