markc / hcp_bs5

A super lightweight Hosting Control Panel for Ubuntu and Debian Mail, Web and DNS servers
https://netserva.org
GNU Affero General Public License v3.0
21 stars 17 forks source link

Command not work #15

Closed fianbiasa closed 1 year ago

fianbiasa commented 3 years ago

curl -s https://raw.githubusercontent.com/netserva/sh/master/bin/setup-sh | bash setup-all

not do anything

markc commented 3 years ago

Sorry about that. I've been refactoring the setup-* scripts and need to do a round of testing to get them all in sync again as I've expanded the distro setup to include Manjaro and Alpine so it will take a while to test all situations.

Did the first setup-sh step work?

fianbiasa commented 3 years ago

Sorry about that. I've been refactoring the setup-* scripts and need to do a round of testing to get them all in sync again as I've expanded the distro setup to include Manjaro and Alpine so it will take a while to test all situations.

Did the first setup-sh step work?

yes, only first setup-sh

and then no command work.

markc commented 3 years ago

Well after a few hours I just got one VM to work all the way through the setup scripts. They're probably still fragile and need more testing but it's worth another shot now...

wget -s https://raw.githubusercontent.com/netserva/sh/master/bin/setup-sh . setup-sh setup-all # optional fqdn vhost arg otherwise it will be hostname -f

Could take from 5 to 10 mins depending on your inet connection and server resources. Feel free to email markc@renta.net direct.

fianbiasa commented 3 years ago

i get this notice

root@hcp:~# hostname -f
hcp.zulfianto.id
root@hcp:~# wget -s https://raw.githubusercontent.com/netserva/sh/master/bin/setup-sh
wget: invalid option -- 's'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
root@hcp:~# wget --s https://raw.githubusercontent.com/netserva/sh/master/bin/setup-sh
wget: option '--s' is ambiguous; possibilities: '--show-progress' '--save-cookies' '--save-headers' '--secure-protocol' '--server-response' '--span-hosts' '--spider' '--start-pos' '--strict-comments'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
root@hcp:~# wget https://raw.githubusercontent.com/netserva/sh/master/bin/setup-sh
--2021-03-28 10:22:13--  https://raw.githubusercontent.com/netserva/sh/master/bin/setup-sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.108.133, 185.199.109.133, 185.199.110.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 447 [text/plain]
Saving to: ‘setup-sh’

setup-sh            100%[===================>]     447  --.-KB/s    in 0s      

2021-03-28 10:22:14 (39.8 MB/s) - ‘setup-sh’ saved [447/447]

root@hcp:~# . setup-sh
Setup NetServa SH scripts
root@hcp:~# setup-all
-bash: setup-all: command not found
root@hcp:~# setup-all
-bash: setup-all: command not found
root@hcp:~# setup-all hcp.zulfianto.id
-bash: setup-all: command not found
root@hcp:~# 

so.. what solution ?

markc commented 3 years ago

OIC, perhaps the /root/.sh folder is already there from a previous run. Let's try this manually, as root...

cd
rm -rf .sh
git clone https://github.com/netserva/sh .sh
.sh/bin/shm install
. .shrc

That last line was missing from the setup-sh script, doh!

If "which setup-all" returns "/root/.sh/bin/setup-all" then this first step is finished so proceed with "setup-all" again. If still not working then paste any obvious errors. Oh, one point, it's worth typing "echo $SHELL" and make sure the current shell is indeed bash. If it's "dash" then "dpkg-reconfigure dash" and set it to bash instead of dash.

fianbiasa commented 3 years ago

STUCK after 30 Minutes

image

fianbiasa commented 3 years ago

i use VPS : CPU 2 Core MEM : 4GB Disk : 80GB

STUCK after 30 Minutes

image

markc commented 3 years ago

Hmm, stuck half way through the first setup-host script. The next step is removing python so maybe it's stuck there. Looks like you are using a Vultr VPS so I'll try one out today and see if I can fix whatever the problem might be. For now just ctrl-c to stop the script and run setup-all again. It's mostly done the package install so it should skip over that part and continue on with the next section and then onto the other scripts.

markc commented 3 years ago

I just did another test in a local VM and got stuck at the same point but I just hit enter in the shell and it continued!

I've made quite a few changes in the last few hours and found lots of little issues. Still working on getting the setup-all to go all the way through without error. Thank goodness for throw away temporary VMs.

markc commented 3 years ago

Well after another 40+ commits I can now get all the way through the setup scripts so it's worth trying again if you can be bothered. I had to revert the default distro to 20.04 because there are too many manual prompts involved in going from 20.10 to 21.04. It would be possible to manually update to 21.04 after the initial install is complete but the real 21.04 server images should be available in a few weeks anyway and then I'll default to "hirsute" again.

fianbiasa commented 3 years ago

hi... thank's for update.

and now.. im at this point.

Creating plugin config file
2 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
2 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating autoload files
2 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
postfix/postfix-script: warning: symlink leaves directory: /etc/postfix/./makedefs.out
### Send message to: admin@mail.hcp.zulfianto.id

when im access IP... Your connection is not private

fianbiasa commented 3 years ago

i try to login using :

sysadm password

can't login.

markc commented 3 years ago

Okay, so all the scripts finished and that last error is because the current SSL certificate is self signed. If you are on a Vultr VPS, or similar VPS, then the root password should be available in the dashboard of this instance. Is that the case?

If it is and you can get in as root, and assuming this system can be reached from the outside world with a public IP, then type "newssl mail.hcp.zulfianto.id". If that works then "addvhost hcp.zulfianto.id" and "newssl hcp.zulfianto.id www" and "nginx -t && nginx -s reload". If you can get to a mostly blank page at https://hcp.zulfianto.id then add "addwp hcp.zulfianto.id" and "shconf hcp.zulfianto.id" to see all the passwords.

fianbiasa commented 3 years ago

Run Command : newssl mail.hcp.zulfianto.id

Cloning into '/etc/dehydrated'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 27 (delta 0), reused 16 (delta 0), pack-reused 0
Unpacking objects: 100% (27/27), 87.46 KiB | 12.49 MiB/s, done.
#
# !! WARNING !! No main config file found, using default config!
#
+ Generating account key...
+ Registering account key with ACME server...
+ Fetching account URL...
+ Done!
# INFO: Using main config file /etc/dehydrated/config
 + Creating chain cache directory /etc/dehydrated/chains
Processing mail.hcp.zulfianto.id
 + Signing domains...
 + Generating private key...
 + Generating signing request...
 + Requesting new certificate order from CA...
 + Received 1 authorizations URLs from the CA
 + Handling authorization for mail.hcp.zulfianto.id
 + 1 pending challenge(s)
 + Deploying challenge tokens...
 + Responding to challenge for mail.hcp.zulfianto.id authorization...
 + Challenge is valid!
 + Cleaning challenge tokens...
 + Requesting certificate...
 + Checking certificate...
 + Done!
 + Creating fullchain.pem...
 + Done!
Remove /etc/nginx/sites-enabled/*.selfsigned

And Run this Command : addvhost hcp.zulfianto.id

Create /root/.vhosts/hcp.zulfianto.id config file
Create u1001 user
Create entry in sysadm.vhosts (mysql)
Create /etc/php/7.4/fpm/pool.d/hcp.zulfianto.id.conf
Create /home/u/hcp.zulfianto.id
Setup /home/u/hcp.zulfianto.id/.ssh/authorized_keys with /root/.ssh/authorized_keys
Create custom chroot symlink
Setup busybox with sh, hostname, tail symlinks
Create /home/u/hcp.zulfianto.id/.profile
Create /home/u/hcp.zulfianto.id/etc/passwd
Create /home/u/hcp.zulfianto.id/etc/group
Create /home/u/hcp.zulfianto.id/var/www/index.html
Create /home/u/hcp.zulfianto.id/var/www/phpinfo.php
Create /home/u/hcp.zulfianto.id/var/www/private/.htpasswd (guest/32644)
Create admin.vmails entry (mysql)
Create admin.valias entry (mysql)
Create /home/u/hcp.zulfianto.id/home/admin/{Maildir,sieve}
Create /home/u/hcp.zulfianto.id/home/admin/.spamprobe
Updated shell password for u1001
Create admin@hcp.zulfianto.id entry in sysadm.vmail_log (mysql)

Then, Run this Command : newssl hcp.zulfianto.id www

# INFO: Using main config file /etc/dehydrated/config
+ Account already registered!
# INFO: Using main config file /etc/dehydrated/config
Processing hcp.zulfianto.id with alternative names: www.hcp.zulfianto.id
 + Creating new directory /etc/dehydrated/certs/hcp.zulfianto.id ...
 + Signing domains...
 + Generating private key...
 + Generating signing request...
 + Requesting new certificate order from CA...
 + Received 2 authorizations URLs from the CA
 + Handling authorization for hcp.zulfianto.id
 + Handling authorization for www.hcp.zulfianto.id
 + 2 pending challenge(s)
 + Deploying challenge tokens...
 + Responding to challenge for hcp.zulfianto.id authorization...
 + Challenge is valid!
 + Responding to challenge for www.hcp.zulfianto.id authorization...
 + Challenge is valid!
 + Cleaning challenge tokens...
 + Requesting certificate...
 + Checking certificate...
 + Done!
 + Creating fullchain.pem...
 + Done!

Last, run this command : nginx -t && nginx -s reload

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Let's See...

fianbiasa commented 3 years ago

Connection to storage server is failed.

when loging to mail

markc commented 3 years ago

Great, it looks like at least 99% of the system is now set up. Is that last error when trying to access webmail at mail.hcp.zulfianto.id or when you get in to webmail and then try to check a mailbox? Probably the 2nd one so try restarting the mail services with "serva restart mail".