Web Server Startup

Good Day Everyone,

I purchased a domain through porkbun. I want to start a Web Server or atleast be given a link or resource on where to start my learning journey, however I feel lost or not sure a specific route to take with it. I am fairly new into IT and even less with FreeBSD. I understand there is LAMP/FAMP. Any suggestions that you senior FreeBSD'ers would recommend to me. Anything is much appreciated.
(www.sizzlecatdaddy.com)
 
Really, really, quick and dirty instructions.

Code:
# Install MySQL
pkg install mysql80-server
# Enable it
sysrc mysql_enable="YES"
# Start the database
service mysql-server start
# Install Apache
pkg install apache24
# Enable it
sysrc apache24_enable="YES"
# Start the web server
service apache24 start
# Install PHP
pkg install php82
# Install mod_php
pkg install mod_php82

# To enable mod_php, edit /usr/local/etc/apache24/modules.d/001_php.conf (file doesn't exist, so create it)
# Should have this content:
<IfModule php_module>
        DirectoryIndex index.php index.html

        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
</IfModule>

# Restart Apache 
service apache24 restart

Congrats, you now have a FAMP; FreeBSD, Apache, MySQL, PHP.

Then create your first website, /usr/local/etc/apache24/Includes/001_mywebsite.conf:
Code:
<VirtualHost *:80>
  ServerName sizzlecatdaddy.com
  
  DocumentRoot /usr/local/www/mywebsite
  DirectoryIndex index.html index.php

  <Directory /usr/local/www/mywebsite>
     AllowOverride None
     Require all granted
  </Directory>
</VirtualHost>

Now you can put your website in /usr/local/www/mywebsite.
 
I think you need to ask yourself.
Am I going to design a website or use some templating system like wordpad.

If you are creative build your own is the best approach.

My choice is www/lighttpd for webserver. It has very few features and is great for basic web.

Here is a good tutorial except the need for vim is very optional. Use base tools of vi or ee to become aquainted with our editors.
 
I really dislike "The Cloud" but when it comes to hosting websites I like the seperation from my hardware.

Consider spending the money on a cloud VM for learning and isolation.

You would be suprised what some people try and jam in the URL bar to try and foul your webserver.
 
I really dislike "The Cloud" but when it comes to hosting websites I like the seperation from my hardware.

Consider spending the money on a cloud VM for learning and isolation.

You would be suprised what some people try and jam in the URL bar to try and foul your webserver.
which cloud provider would you recommend?
 
When it comes time to publically share your webserver you need to consider a security policy.

I chose security/tripwire as an alert system. If any files on my tripwire list are used/accessed I get an alert emailed.

So the workflow would be to design website on home computer and upload to cloud VM (using SSH/SCP strong key based auth).
Setup tripwire so any critical files accessed you get notified.
Everytime you modify website content you have to update tripwires database and reload.
I like it for hardnening.
 
I will let others offer cloud guidance. I used Linode and it was cheap.
It used a custom version of Virsh called Lirsh which made back-end managment easy if you know virsh command line structure..

These backend interfaces can be important if new. You will lock yourself out of your VM at some point and need a rescue mechanism.

Most cloud providers provide a web interface command console for recovery and more. Like uploading a custom image.
 
as long they offer freebsd get the cheapest/closest to you (less lag from your home connection). make sure they offer vnc or web console.
you can get free dns at he.net or namecheap.com
i used buyvm.net / cheap no bs
get at least 1gb of ram
 
One problem with Cloud Providers is reputation. Some are worse than others.

Linode has a large number of spammers so their IP ranges are blocked from alot of email relays.

Not a problem for a webserver but food for thought if you ever want an email server on your domain.

I want to note that Raspberry Pi boards or old computers make for a good learning platform for local webserving if you want to avoid a cloud VM.
 
for learning, experimenting reputation is not that important. cloud is nice that you don't mess with the hardware, and always have console access, usually good bw
 
I think you need to ask yourself.
Am I going to design a website or use some templating system like wordpad.

If you are creative build your own is the best approach.

My choice is www/lighttpd for webserver. It has very few features and is great for basic web.

Here is a good tutorial except the need for vim is very optional. Use base tools of vi or ee to become aquainted with our editors.
I kinda wanna be creative and perhaps code with php, ruby and other web dev languages. Ruby is really standing out to me at the moment
 
I was talking more about look not languages. Cookie cutter looks good with no learning. Aka wordpress.
More about content and not working on site look. Like your snazzy landing page now. Template driven.

Creative means learning CSS and moving up from there in my opinion. Then move to your php and upward.

There is nothing wrong with a template stytle for documentation sites.
I want to try Sphinx

I like the Netgate documentation server which I believe is based on sphinx.
 
I was talking more about look not languages. Cookie cutter looks good with no learning. Aka wordpress.
More about content and not working on site look. Like your snazzy landing page now. Template driven.

Creative means learning CSS and moving up from there in my opinion. Then move to your php and upward.

There is nothing wrong with a template stytle for documentation sites.
I want to try Sphinx

I like the Netgate documentation server which I believe is based on sphinx.
I found a great html/css course on udemy, i have udemy for free with military. I understand what you are saying and it makes sense.
 
Back
Top