more readme
This commit is contained in:
@@ -59,115 +59,3 @@ cd openbsd-onboard
|
|||||||
./install-lamp.ksh
|
./install-lamp.ksh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
set -o vi
|
|
||||||
|
|
||||||
|
|
||||||
# WEB SERVER
|
|
||||||
|
|
||||||
WEB
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Configure
|
|
||||||
cp -p /etc/examples/httpd.conf /etc/
|
|
||||||
nvim /etc/httpd.conf
|
|
||||||
|
|
||||||
# Start
|
|
||||||
rcctl enable httpd
|
|
||||||
rcctl start httpd
|
|
||||||
rcctl status httpd
|
|
||||||
|
|
||||||
# Check
|
|
||||||
fstat | grep ':80'
|
|
||||||
httpd -n
|
|
||||||
|
|
||||||
# Test
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
PHP
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pkg_info -Q php | grep 7.4
|
|
||||||
pkg_info -Q php | grep 8.1
|
|
||||||
pkg_add wget unzip composer git
|
|
||||||
pkg_add libxml xz png jpeg libiconv
|
|
||||||
|
|
||||||
pkg_add `pkg_info -Q php | grep 7.4.33 | grep -v debug`
|
|
||||||
# The following new rcscripts were installed:
|
|
||||||
#
|
|
||||||
# /etc/rc.d/apache2
|
|
||||||
# /etc/rc.d/netsnmpd
|
|
||||||
# /etc/rc.d/netsnmptrapd
|
|
||||||
# /etc/rc.d/php74_fpm
|
|
||||||
# /etc/rc.d/saslauthd
|
|
||||||
```
|
|
||||||
|
|
||||||
Database
|
|
||||||
|
|
||||||
```sh
|
|
||||||
# Installation
|
|
||||||
pkg_add mariadb-server php_mysqli php_pdo_mysql
|
|
||||||
|
|
||||||
# Start
|
|
||||||
rcctl enable mysqld
|
|
||||||
rcctl start mysqld
|
|
||||||
rcctl check mysqld
|
|
||||||
|
|
||||||
# Setup
|
|
||||||
mysql_install_db # create system tables and binary files
|
|
||||||
mysql_secure_installation # Enable socket at /var/run/mysql.sock
|
|
||||||
```
|
|
||||||
|
|
||||||
`/etc/my/cnf`
|
|
||||||
|
|
||||||
```ini
|
|
||||||
[client-server]
|
|
||||||
socket=/var/run/mysql/mysql.sock
|
|
||||||
port=3306
|
|
||||||
```
|
|
||||||
|
|
||||||
Test mysql
|
|
||||||
|
|
||||||
```sh
|
|
||||||
mysql -uroot -p1234 -e 'CREATE USER drupal@localhost IDENTIFIED BY "1234"'
|
|
||||||
mysql -uroot -p1234 -e 'CREATE DATABASE drupal'
|
|
||||||
mysql -uroot -p1234 -e 'GRANT ALL ON drupal.* TO drupal@localhost'
|
|
||||||
mysql -uroot -p1234 -e 'FLUSH PRIVILEGES'
|
|
||||||
```
|
|
||||||
|
|
||||||
Test php mysql
|
|
||||||
|
|
||||||
`/var/www/htdocs/test.php`
|
|
||||||
|
|
||||||
```php
|
|
||||||
<?php
|
|
||||||
$servername = "127.0.0.1";
|
|
||||||
$user = "drupal";
|
|
||||||
$pass = "1234";
|
|
||||||
$conn = new mysqli($servername, $user, $pass);
|
|
||||||
if ($conn->connect_error) {
|
|
||||||
die("Database Connection failed: " . $conn->connect_error);
|
|
||||||
}
|
|
||||||
echo "Database connected successfully, Congratulations ";
|
|
||||||
?>
|
|
||||||
```
|
|
||||||
|
|
||||||
```sh
|
|
||||||
curl http://localhost/test.php
|
|
||||||
```
|
|
||||||
|
|
||||||
HTTPD
|
|
||||||
|
|
||||||
```sh
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,100 @@
|
|||||||
|
# WEB SERVER
|
||||||
|
|
||||||
|
WEB
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Configure
|
||||||
|
cp -p /etc/examples/httpd.conf /etc/
|
||||||
|
nvim /etc/httpd.conf
|
||||||
|
|
||||||
|
# Start
|
||||||
|
rcctl enable httpd
|
||||||
|
rcctl start httpd
|
||||||
|
rcctl status httpd
|
||||||
|
|
||||||
|
# Check
|
||||||
|
fstat | grep ':80'
|
||||||
|
httpd -n
|
||||||
|
|
||||||
|
# Test
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
PHP
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pkg_info -Q php | grep 7.4
|
||||||
|
pkg_info -Q php | grep 8.1
|
||||||
|
pkg_add wget unzip composer git
|
||||||
|
pkg_add libxml xz png jpeg libiconv
|
||||||
|
|
||||||
|
pkg_add `pkg_info -Q php | grep 7.4.33 | grep -v debug`
|
||||||
|
# The following new rcscripts were installed:
|
||||||
|
#
|
||||||
|
# /etc/rc.d/apache2
|
||||||
|
# /etc/rc.d/netsnmpd
|
||||||
|
# /etc/rc.d/netsnmptrapd
|
||||||
|
# /etc/rc.d/php74_fpm
|
||||||
|
# /etc/rc.d/saslauthd
|
||||||
|
```
|
||||||
|
|
||||||
|
Database
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Installation
|
||||||
|
pkg_add mariadb-server php_mysqli php_pdo_mysql
|
||||||
|
|
||||||
|
# Start
|
||||||
|
rcctl enable mysqld
|
||||||
|
rcctl start mysqld
|
||||||
|
rcctl check mysqld
|
||||||
|
|
||||||
|
# Setup
|
||||||
|
mysql_install_db # create system tables and binary files
|
||||||
|
mysql_secure_installation # Enable socket at /var/run/mysql.sock
|
||||||
|
```
|
||||||
|
|
||||||
|
`/etc/my/cnf`
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[client-server]
|
||||||
|
socket=/var/run/mysql/mysql.sock
|
||||||
|
port=3306
|
||||||
|
```
|
||||||
|
|
||||||
|
Test mysql
|
||||||
|
|
||||||
|
```sh
|
||||||
|
mysql -uroot -p1234 -e 'CREATE USER drupal@localhost IDENTIFIED BY "1234"'
|
||||||
|
mysql -uroot -p1234 -e 'CREATE DATABASE drupal'
|
||||||
|
mysql -uroot -p1234 -e 'GRANT ALL ON drupal.* TO drupal@localhost'
|
||||||
|
mysql -uroot -p1234 -e 'FLUSH PRIVILEGES'
|
||||||
|
```
|
||||||
|
|
||||||
|
Test php mysql
|
||||||
|
|
||||||
|
`/var/www/htdocs/test.php`
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
$servername = "127.0.0.1";
|
||||||
|
$user = "drupal";
|
||||||
|
$pass = "1234";
|
||||||
|
$conn = new mysqli($servername, $user, $pass);
|
||||||
|
if ($conn->connect_error) {
|
||||||
|
die("Database Connection failed: " . $conn->connect_error);
|
||||||
|
}
|
||||||
|
echo "Database connected successfully, Congratulations ";
|
||||||
|
?>
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl http://localhost/test.php
|
||||||
|
```
|
||||||
|
|
||||||
|
HTTPD
|
||||||
|
|
||||||
|
```sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user