Skip to content

Commit

Permalink
Add Ubuntu Linux support
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Dec 29, 2024
1 parent 98fea8d commit f1d4aa6
Show file tree
Hide file tree
Showing 6 changed files with 350 additions and 109 deletions.
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
- *`action_name`*: `fetch`, `init`, `install`, `start`, `stop`, `restart`
- *`targets`*: optional, possible values: `all`, `nginx`, `php`, `phpmyadmin`, `mysql`

## Support platforms

- Windows: ready
- Ubuntu Linux: testing
- nginx, mysql runas current user
- php runas root

examples:

- `xweb.ps1 install`
Expand All @@ -18,19 +25,19 @@ examples:

Note: if xweb was moved to other location, please rerun `xweb.ps1 init nginx -f`

## 导入数据库失败解决方案
## 导入数据库失败解决方案

1. 阿里云新版本 DMS 导出的数据库,没有 create table 语句,不能一键导入?
1. 阿里云新版本 DMS 导出的数据库,没有 create table 语句,不能一键导入?

解决方案: 导出时选择导出“数据和结构”, 勾选压缩 insert 语句
解决方案: 导出时选择导出“数据和结构”, 勾选压缩 insert 语句


2. 网页导出
2. 网页导出

删除首尾: `FOREIGN_KEY_CHECKS` 相关语句
去除 UTF-8 BOM
删除首尾: `FOREIGN_KEY_CHECKS` 相关语句
去除 UTF-8 BOM

## 重置 mysql 密码:
## 重置 mysql 密码:

- Linux
vim /etc/my.cnf
Expand All @@ -42,10 +49,10 @@ Note: if xweb was moved to other location, please rerun `xweb.ps1 init nginx -f`
```sh
systemctl stop mysqld.service
systemctl start mysqld.service
mysql –u root
mysql –u root
```
- Windows
1. 执行:`mysqld --skip-grant-tables`(窗口会一直停止) 
2. 然后另外打开一个命入令行窗口,执行 mysql(或者直接进入Mysql Command Line Cilent),此时无需输入密码即可进入。
1. 执行:`mysqld --skip-grant-tables`(窗口会一直停止) 
2. 然后另外打开一个命入令行窗口,执行 mysql(或者直接进入Mysql Command Line Cilent),此时无需输入密码即可进入。
21 changes: 17 additions & 4 deletions etc/certs/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# - https://certificatetools.com/
# cert settings

script_dir=$(cd "$(dirname "$0")" && pwd)
cd $script_dir

function years_to_days {
years=$1
time_ts=`date +%s`
Expand All @@ -18,19 +21,27 @@ function years_to_days {
}

is_v1=$1
force=$2
key_bits=2048
common_name="*.simdsoft.com"
# firefox requre domain name
domain_name="xweb.com"
hash_alg=-sha384
issued_org='Simdsoft Limited'

# issuer information
issuer_valid_years=1000
issuer_valid_years=100
issuer_org='Simdsoft Limited'
issuer_name="Simdsoft RSA CA $issuer_valid_years"
issuer_subj="/C=CN/O=$issuer_org/CN=$issuer_name"


valid_years=1000
valid_years=$issuer_valid_years

if [ "$force" = 'true' ] ; then
echo 'force regen certs ...'
rm ./ca-**
rm ./server.*
fi

# Create Self-Signed Root CA(Certificate Authority)
issuer_valid_days=`years_to_days $issuer_valid_years`
Expand All @@ -48,7 +59,7 @@ fi

# 1. Generate unencrypted 2048-bits RSA private key for the server (CA) & Generate CSR for the server
valid_days=`years_to_days $valid_years`
openssl req -newkey rsa:$key_bits $hash_alg -nodes -keyout server.key -out server-csr.pem -subj "/C=CN/O=$issued_org/CN=$common_name"
openssl req -newkey rsa:$key_bits $hash_alg -nodes -keyout server.key -out server-csr.pem -subj "/C=CN/O=$issued_org/CN=$domain_name"

# 2. Sign with our RootCA
if [ "$is_v1" != 'true' ] ; then
Expand All @@ -63,3 +74,5 @@ rm -rf ./server-csr.pem

# Check if the certificate is signed properly
openssl x509 -in server.crt -noout -text

cd -
7 changes: 7 additions & 0 deletions etc/certs/v3.ext
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
[alt_names]
DNS.1 = xweb.com
DNS.2 = *.xweb.com
26 changes: 26 additions & 0 deletions etc/mysql/my.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is designed to work with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have either included with
# the program or referenced in the documentation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#
# The MySQL Client configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

[mysqld]
mysql_native_password=ON
authentication_policy=mysql_native_password
Expand Down
1 change: 0 additions & 1 deletion etc/nginx/1.27.3/nginx.conf.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#user nobody;
worker_processes 1;

Expand Down
Loading

0 comments on commit f1d4aa6

Please sign in to comment.