我正在Windows上使用xampp,但我想使用更接近我的服务器设置的东西。
Federico Cargnelutti教程解释了如何设置LAMP VMWARE虚拟机,这是VMware虚拟机的很好介绍,但其中一个命令无法正常工作,并且它没有描述如何更改键盘布局和时区。
PS:命令很容易找到,但我不想每次重新安装服务器时都去寻找它们。我将此问题用作提醒。
PS:命令很容易找到,但我不想每次重新安装服务器时都去寻找它们。我将此问题用作提醒。
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
这是一些比较专业的内容,但你应该能够理解。如果你将它保存到一个文件中(例如“install”),那么你只需要执行以下操作:
chmod +x install
./install
我的一些 apt-get 命令是不必要的,因为 apt 会自动获取依赖项,但我更喜欢具体说明我的安装需求。
sudo apt-get update sudo apt-get upgrade sudo dpkg-reconfigure console-setup sudo dpkg-reconfigure tzdata sudo vim /etc/network/interfaces
sudo tasksel install lamp-server
我不太明白你的问题,因为我没有看到一个明确的问题。但是我会尽力推断出两个问题:要更改键盘布局,请查看Ubuntu论坛上的forum post;要更改时区,请查看forum post。