Welcome to Hidden Answers, also at hiddenanswers.i2p

Español - Português - Ру́сский

1 like 0 dislike

So I want to host a website on the deepweb for learning purposes.
From what I gathered it's a viable choice to host it myself. I have a few old computers at home and I would like to know what is more important for a webserver to run well

RAM or CPU?

Also those laptops are 32 bits so what OS would you choose with these conditions?

Also also I don't think i've done my research correctly so i'll ask this as well:
what's better Intel centrino duo or intel atom?

Thanks in advance for your answers.

asked ago in Technology by N00b 101 (70 points)  
edited ago by

2 Answers

0 like 0 dislike

Since you're hosting a static website, CPU is more important. A faster CPU will serve the content quicker, assuming that you also have enough RAM to handle the workload. *BSD and Debian are popular choices for server OS. I think the centrino duo is more powerful than the atom, but you should verify on ark.intel and choose the more powerful one.

answered ago by Executive (26,610 points)  

turns out the intel atom is better , thank you I completely forgot that ark.intel was a thing.
So I installed debian 10 on the right computer (no desktop environment obviously) and it's only using up 60Mb of RAM out of my 2GB so I assume 2GB of RAM is plenty enough.

Now to make a server, I planned on using nginx as recommended but this is where i'm a bit lost I don't know how to use it.

That's where your education truly begins. You'll have to read documentation and figure things out through trial and error. Sometime you can find direct answers to your questions, but it's important that you understand what you're doing rather than just copying and pasting from someone else.

0 like 0 dislike

I use VMs running Ubuntu server which uses 2 gig of ram and 1 core per VM and everything works perfectly.

I want you to appreciate the hours it took to work this out from taking hours to install down to about 5 minutes. If you follow this correctly you will have a server running in ubuntu in 5 minutes. I have been meaning to automate this process but it is still a pending side project.

enjoy :)

APT update and upgrade

sudo apt update
sudo apt upgrade
sudo apt install net-tools -y

Openssh

sudo apt-get install openssh-server -y

install nginx

sudo apt install nginx -y
sudo systemctl stop nginx.service
sudo systemctl start nginx.service
sudo systemctl enable nginx.service

PHP install 7.4-fpm

sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update
sudo apt-get upgrade -y
sudo apt install php7.4-fpm php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip unzip -y

Remove default html

sudo rm /var/www/html/*

PHP test page

sudo nano /var/www/html/index.php

  • <?PHP echo "w00t"; ?>

edit php.ini

sudo nano /etc/php/7.4/fpm/php.ini

  • memory_limit = 256M
  • file_uploads = On
  • allow_url_fopen = On
  • upload_max_filesize = 64M

Edit nginx default

sudo nano /etc/nginx/sites-available/default
-add index.php
-#uncomment to match below

server {

listen 80;
listen [::]:80;
root /var/www/html;
index  index.php index.html index.htm;
server_name  example.com www.example.com;

location / {
    try_files $uri $uri/ =404;       
}
 # pass PHP scripts to FastCGI server
    #
    location ~ \.php$ {
           include snippets/fastcgi-php.conf;
    #
    #       # With php-fpm (or other unix sockets):
           fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    #       # With php-cgi (or other tcp sockets):
    #       fastcgi_pass 127.0.0.1:9000;
    }

}

Restart services

sudo systemctl restart nginx.service
sudo systemctl restart php7.4-fpm.service

check phpinfo

sudo nano /var/www/html/phpinfo.php

  • <?php phpinfo( ); ?>

check index.php

w00t

install vsftpd

sudo apt-get install vsftpd -y
sudo nano /etc/vsftpd.conf

  • local_unmask=022
  • write-enable=YES
    -- local_root=/var/www/html/
    -- allow_writeable_chroot=YES

add user www

sudo adduser www

FTP folder permissions

sudo chown www /var/www/html/

sudo systemctl restart vsftpd

MySQL

sudo apt install mysql-server
sudo mysql_secure_installation
sudo mysql -u root -p
CREATE USER 'sql'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES on . to 'sql'@'localhost';
exit

add tor address

sudo nano /etc/tor/torrc

  • add IP information in and save
    sudo service tor restart
    sudo cat /var/lib/tor/(directory)/hostname
answered ago by N00b 2.0 (250 points)  

Thanks a ton for this, problem is I'm on debian so i can't install php7.4 properly

move to ubuntu then :P

...