gpt4 book ai didi

ubuntu - 你如何设置你的LAMP测试服务器?

转载 作者:太空宇宙 更新时间:2023-11-03 16:48:28 25 4
gpt4 key购买 nike

我在 Windows 上使用 xampp,但我想使用更接近我的服务器设置的东西。

Federico Cargnelutti tutorial说明如何设置 LAMP VMWARE 设备;这是对 VMware 设备的精彩介绍,但其中一个命令不起作用,并且没有描述如何更改键盘布局和时区。

ps:这些命令很容易找到,但我不想每次重装服务器时都去寻找它们。我用这个问题作为提醒。

最佳答案

这是我的安装脚本,我在 debian 服务器上使用它,但它可以在 Ubuntu 中运行(Ubuntu 是在 Debian 上构建的)

apt-get -yq update
apt-get -yq upgrade
apt-get -yq install sudo
apt-get -yq install gcc
apt-get -yq install g++
apt-get -yq install make
apt-get -yq install apache2
apt-get -yq install php5
apt-get -yq install php5-curl
apt-get -yq install php5-mysql
apt-get -yq install php5-gd
apt-get -yq install mysql-common
apt-get -yq install mysql-client
apt-get -yq install mysql-server
apt-get -yq install phpmyadmin
apt-get -yq install samba
echo '[global]
workgroup = workgroup
server string = %h server
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
;invalid users = root
unix password sync = no
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n *password\supdated\ssuccessfully* .
socket options = TCP_NODELAY
[homes]
comment = Home Directories
browseable = no
writable = no
create mask = 0700
directory mask = 0700
valid users = %S
[www]
comment = WWW
writable = yes
locking = no
path = /var/www
public = yes' > /etc/samba/smb.conf
(echo SAMBAPASSWORD; echo SAMBAPASSWORD) | smbpasswd -sa root
echo 'NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>' > /etc/apache2/sites-enabled/000-default
/etc/init.d/apache2 stop
/etc/init.d/samba stop
/etc/init.d/apache2 start
/etc/init.d/samba start

编辑:添加这个来设置你的 MySQL 密码

/etc/init.d/mysql stop
echo "UPDATE mysql.user SET Password=PASSWORD('MySQLPasswrod') WHERE User='root'; FLUSH PRIVILEGES;" > /root/MySQLPassword
mysqld_safe --init-file=/root/MySQLPassword &
sleep 1
/etc/init.d/mysql stop
sleep 1
/etc/init.d/mysql start

结束编辑

这有点特别,但你明白了,如果你把它保存到一个文件(例如“安装”),你所要做的就是:

chmod +x install
./install

我的一些 apt-get 命令不是必需的,因为 apt 会自动获取依赖项,但我更愿意为我的安装提供特定的依赖项。

关于ubuntu - 你如何设置你的LAMP测试服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15040/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com