質問
Windows で xampp を使用していますが、サーバー設定に近いものを使用したいと考えています。
フェデリコ・カーネルッティのチュートリアル LAMP VMWARE アプライアンスのセットアップ方法について説明します。これは VMware アプライアンスへの優れた入門書ですが、コマンドの 1 つが機能せず、キーボード レイアウトとタイムゾーンを変更する方法については説明されていません。
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 は依存関係を自動的に取得するため、apt-get コマンドの一部は必要ありませんが、インストールの場合は具体的にすることを好みます。
他のヒント
VMware ワークステーション、VMware Player、または vmware アプライアンスを実行できるものなら何でも持っていると仮定すると、必要なのは次のことだけです。
- ダウンロード、解凍 Ubuntu 8.04サーバー そして仮想マシンを起動します。
- ubuntu を更新し、レイアウトとタイムゾーンを設定します。
sudo apt-get update sudo apt-get upgrade sudo dpkg-reconfigure console-setup sudo dpkg-reconfigure tzdata sudo vim /etc/network/interfaces
- 固定IPを設定する (オプション)。
- Apache+mysql+phpをインストールします。
sudo tasksel install lamp-server
この質問に適切にタグが付けられていれば、Ubuntu のインストール中に LAMP サーバー オプションを選択できます。これにより、必要なコンポーネントがすべて自動的にインストールおよび構成されます。これを行う方法の詳細な手順は、たとえば次の場所にあります。 http://www.ubuntueek.com/ubuntu-804-hardy-heron-lamp-server-setup.html
LAMP、RoR、Python Django、Java Stack、Spring などのサーバーを Ubuntu ベースの VM イメージ用に迅速にカスタマイズできます。 http://www.elasticserver.com - Unbuntu 8.04LTS がサポートされるようになりました。