Ну что ж, приступим. Для начала стоит обновить все пакеты в системе:
aptitude update && aptitude upgrade
Примечание: если вы залогинились не из под root’а вам необходимо использовать программу sudo для выполнения этих команд, так как они требуют прав администратора.
Теперь можно установить нужные пакеты:
aptitude install apache2 php5 php5-mysql mysql-server proftpd
Во время установки mysql-server будет предложено ввести пароль для root: Так же proftpd предложит выбрать вариант конфигурации: Я выбрал standalone.
Когда установка завершена настроем наш apache2 так, что бы можно было держать два(или более) разных сайтов на одной машине. Для этого создадим для каждого сайта отдельные директории в папке /var/www/. Я буду использовать два сайта с именами maintest и secondtest, поэтому создам такие директории:
mkdir /var/www/maintest
mkdir /var/www/secondtest
Не забудем так же создать файлы логов для каждого сайта:
touch /var/log/apache2/maintest-error.log
touch /var/log/apache2/secondtest-error.log
После этого нужно настроить конфиг для каждого сайта. Перейдите в директорию /etc/apache2/sites-available/ командой:
cd /etc/apache2/sites-available
Создайте в ней два файла с именами сайтов. Я сделал так:
touch maintest
touch secondtest
Примечание: для удобства работы с файлами вы можете не использовать полный путь, а просто переходить в нужную папку с помощью команды cd, а уже оттуда пользоваться относительным путем. Так же можно использовать файловый менеджер mc.
Теперь нужно заполнить каждый файл настройками. Открываем в любом редакторе, я использовал nano и пишем:
ServerName maintest
DocumentRoot /var/www/maintest
ErrorLog /var/log/apache2/maintest-error.log
Аналогичные операции нужно проделать и со вторым файлом, лишь заменив maintest на secondtest(ну или ваше название).
Примечание: вы можете использовать любое допустимое имя для сайта, но советую использовать короткие и понятные для удобства конфигурирования.
Теперь нужно активировать сайты. Кроме того я деактивирую стандартный конфиг, что бы клиенты могли получать доступ только к /var/www/maintest или /var/www/secondtest. Делается это так:
a2ensite maintest
a2ensite secondtest
a2dissite default
Утилита a2ensite(apache2 enable site) активирует сайт, добавляя на него симлинк в папку /etc/apache2/sites-enabled, а утилита a2dissite(apache2 disable site) как вы уже догадались дективирует сайт. Кстати, если вам не нужны стандартные конфиги, вы можете их удалить командой:
rm /etc/apache2/sites-available/default* -R
Необходимо перезапустить apache2:
/etc/init.d/apache2 restart
Теперь изменим файл hosts на рабочей машине. В windows он лежит в папке C:WindowsSystem32driversetc, а в linux — /etc/. У меня в результате на windows машине получился такой файл:
192.168.1.102 maintest
192.168.1.102 secondtest
После перезагрузки проверим как все работает, и как себя чувствует php. Для этого создадим два файла, один в /var/www/maintest/, а другой в /var/www/secondtest/. Оба назовем index.php:
touch /var/www/maintest/index.php
touch /var/www/secondtest/index.php
Заполним каждый следующими строчками:
Потом попробуйте с вашей рабочей машины зайти на maintest или secondtest. Вы должны увидеть следующее: Если видите — значит все работает. Осталось настроить proftpd. Для использования ftp-сервера нам понадобится создать еще одного пользователя с ограниченными правами. Перед этим нужно открыть файл /etc/shells и добавить в конец строчку /bin/false. Пользователя создаем командой:
useradd ftpuser -p ftppass -d /var/www -s /bin/false
Где ftpuser — имя пользователя(можете выбрать свое), ftppass — пароль(выберете свой), /var/www — домашняя директория. Теперь можно приступить к редактированию конфига proftpd. Сделаем бекап стандартной конфигурации:
mv /etc/proftpd/proftpd.conf /etc/proftpd/proftpd.conf_backup
Теперь создаем новый конфиг и открываем его для редактирования вашим редактором. Если вы используете nano, тогда это можно сделать одной командой:
nano /etc/proftpd/proftpd.conf
У меня получился следующий конфиг:
#Разрешение на перезапись
Allowoverwrite on
#Авторизация только по алиасам пользователя
AuthAliasOnly on
#Алиас для пользователя
UserAlias admin ftpuser
#Имя сервера
ServerName «server-lamp-debian»
#Тип сервера
ServerType standalone
#Пользователь и группа под которыми будет запущен сервер
User nobody
Group nogroup
#Задержка привествия
DeferWelcome on
#Использование по умолчанию
DefaultServer on
#Логин из под рута
RootLogin off
#Файлы логов
ExtendedLog /var/log/proftpd/ftp.log
TransferLog /var/log/proftpd/xfer.log
SystemLog /var/log/proftpd/system.log
#Использования файла /etc/ftpusers
UseFtpUsers off
#Разрешить перезагрузку хранилища
AllowStoreRestart on
#Порт
Port 21
#Дефолтная папка
DefaultRoot /var/www/
#Запрещаем выход за пределы домашней папки
DefaultRoot ~
В принципе ничего сложного. Осталось перезапустить proftpd командой:
/etc/init.d/proftpd restart
А так же не забудьте назначить права для папки /var/www/:
chmod 777 /var/www/ -R
Все должно работать. Для проверки используйте любой файловый менеджер поддерживающий ftp или ftp клиент. Просто перейдите по ftp://maintest.
Для удобства работы с базой данный вы можете установить phpmyadmin:
aptitude install phpmyadmin
Или использовать какой-нибудь SQL-клиент. Тогда нужно будет добавить в базу данных нового пользователя или существующего и разрешить ему соединение с внешней сети. Например следующая команда создаст нового пользователя с логином user и паролем password, разрешит ему все операции для всех баз данных, а так же соединение с любого хоста:
GRANT ALL PRIVILEGES ON *.* TO user@»%»
IDENTIFIED BY ‘password’ WITH GRANT OPTION;
Подробнее можете почитать здесь. Кроме того понадобится отредактировать конфиг /etc/mysql/my.cnf, закоментировав строчку bind-address 127.0.0.1.
Удачной настройки. Задавайте свои ответы.
This web site really has all of the info I needed
concerning this subject and didn’t know who to ask.
Stop by my blog … online casino 50 deposit philippines
What’s up friends, how is all, and what you would like
to say about this post, in my view its truly amazing in favor of me.
Feel free to surf to my blog; casino online gambling data
I every time emailed this blog post page to all my associates,
for the reason that if like to read it then my friends will too.
Here is my page :: is online gambling illegal in north carolina
After looking at a handful of the blog posts on your web page, I seriously appreciate your technique of writing a blog.
I added it to my bookmark webpage list and will be checking back soon. Please check out my website as well
and tell me how you feel.
Feel free to surf to my blog; บริการรูดบัตรเครดิต
Wow, awesome blog layout! How long have you been blogging
for? you made blogging look easy. The overall look of your website
is excellent, let alone the content!
Also visit my web site; online gambling casino legal
Hello would you mind stating which blog platform you’re
working with? I’m going to start my own blog soon but I’m having a difficult time deciding
between BlogEngine/Wordpress/B2evolution and Drupal. The reason I ask is
because your design and style seems different then most blogs and
I’m looking for something completely unique.
P.S My apologies for getting off-topic but I had to
ask!
my blog post; ร้านสเต็กรัชโยธิน
Hi, I do believe this is an excellent website. I stumbledupon it ;
) I am going to come back once again since I saved as a favorite
it. Money and freedom is the best way to change,
may you be rich and continue to help others.
Take a look at my homepage … ขายไวน์
An impressive share! I’ve just forwarded this onto
a friend who has been conducting a little
homework on this. And he in fact ordered me dinner because I stumbled upon it
for him… lol. So allow me to reword this….
Thanks for the meal!! But yeah, thanks for spending some time to talk about this
subject here on your internet site.
My homepage :: รถ เช่า budget อุบล
Hello, I enjoy reading through your article post. I like to write a little
comment to support you.
my blog post; 888 online casino pa
Today, I went to the beach with my children. I found a sea shell
and gave it to my 4 year old daughter and said
«You can hear the ocean if you put this to your ear.» She placed the shell to
her ear and screamed. There was a hermit crab inside and it
pinched her ear. She never wants to go back!
LoL I know this is totally off topic but I had to tell someone!
my web-site; รถเช่าสงขลา
I am not sure where you are getting your information, but good topic.
I needs to spend some time learning more or understanding more.
Thanks for excellent info I was looking for this information for my
mission.
My blog; what does minus 9 mean in betting
Hello There. I found your blog the usage of msn. That is
an extremely well written article. I’ll be sure to bookmark it and return to read extra of your useful info.
Thank you for the post. I’ll definitely comeback.
Also visit my blog: discuss
Hi there, i read your blog from time to time and i own a similar one and i
was just wondering if you get a lot of spam remarks?
If so how do you prevent it, any plugin or anything you can advise?
I get so much lately it’s driving me insane so
any assistance is very much appreciated.
Review my webpage … bet22 online betting live casino
I think this is among the most significant information for me.
And i’m glad reading your article. But wanna remark
on some general things, The site style is ideal, the articles is
really nice : D. Good job, cheers
my web blog … Online Casino Betting
Thanks for any other wonderful post. Where else may just anybody get that kind of
info in such a perfect way of writing? I have a presentation subsequent week, and I’m at
the search for such info.
Also visit my webpage: lunawin เครดิตฟรี
Pretty component to content. I simply stumbled upon your site and in accession capital to say that
I get in fact loved account your blog posts. Anyway I’ll be subscribing on your augment and even I
success you get right of entry to consistently
fast.
Visit my website: niubi 07 online casino
What’s up i am kavin, its my first occasion to commenting anywhere, when i read this paragraph i thought
i could also make comment due to this brilliant post.
Also visit my web page … does virginia have online gambling
These are in fact impressive ideas in about blogging.
You have touched some pleasant points here. Any way keep up
wrinting.
my webpage … discuss
I used to be recommended this web site through my cousin.
I’m not sure whether this post is written by means of him as nobody else recognize such particular
about my difficulty. You are amazing! Thank you!
Have a look at my blog: 918kissauto เครดิตฟรี
Hey there! This is my 1st comment here so I just
wanted to give a quick shout out and tell you I genuinely enjoy reading through your articles.
Can you suggest any other blogs/websites/forums that deal with the same topics?
Thank you!
Visit my blog — faw 99 เครดิตฟรี
Fine way of describing, and pleasant article to get facts on the topic of
my presentation focus, which i am going to present in institution of higher education.
My homepage :: australian online casino
Insightful read! I found your perspective very engaging. For more detailed information, visit: READ MORE. Eager to see what others have to say!
When I originally commented I clicked the «Notify me when new comments are added» checkbox and now each time
a comment is added I get several e-mails with the same comment.
Is there any way you can remove people from that service? Many thanks!
Also visit my site … best online casino uk
Hi there, after reading this remarkable paragraph i am too cheerful
to share my knowledge here with colleagues.
Feel free to surf to my web site — บา คา ร่า วอ เลท เครดิตฟรี
Great post.
my web blog — fun88 เข้าระบบ
Heya just wanted to give you a brief heads up and let you know a few of the
pictures aren’t loading correctly. I’m not sure why but I think
its a linking issue. I’ve tried it in two different web browsers and both show the
same results.
Stop by my site fun88 เข้าระบบ
I love what you guys are usually up too. Such clever work and coverage!
Keep up the excellent works guys I’ve included you guys to blogroll.
My homepage รถเช่าสงขลา
Right away I am going away to do my breakfast, once
having my breakfast coming yet again to read other news.
My homepage รถเช่าอุบล สนามบิน
Aw, this was a very nice post. Taking a few minutes and actual effort to generate a good article… but what can I say… I hesitate a lot and don’t seem
to get anything done.
Feel free to surf to my site — Online Casino Betting
Can I simply just say what a comfort to find somebody that truly knows what they are discussing online.
You actually know how to bring an issue to light and make
it important. A lot more people ought to read this and understand this side of the
story. I was surprised that you’re not more popular because you certainly have the gift.
My blog :: best online casino betting sites
Have you ever thought about writing an e-book or
guest authoring on other sites? I have a blog based upon on the same information you discuss and would really
like to have you share some stories/information. I know my readers would value your work.
If you are even remotely interested, feel free to shoot me an e-mail.
Visit my web blog ocean99 เครดิต ฟรี
Hey very interesting blog!
Have a look at my web page … online casino uk
I am sure this piece of writing has touched all the internet visitors, its really really nice article on building
up new blog.
Here is my homepage … online casino betting philippines
We are a group of volunteers and starting a new scheme in our community.
Your website offered us with valuable info to
work on. You have done a formidable job and our whole community will be grateful to you.
Also visit my web blog :: big daddy casino online betting
Hi to every one, the contents present at this web
site are genuinely remarkable for people experience, well, keep
up the nice work fellows.
Feel free to surf to my web-site :: fm99bet เครดิต ฟรี
You can certainly see your enthusiasm in the article you write.
The arena hopes for even more passionate writers like you who are not afraid to say how
they believe. At all times go after your heart.
Also visit my webpage … online casino betting in maryland
Hi! I know this is kinda off topic but I was wondering which blog platform are you using for this site?
I’m getting tired of WordPress because I’ve had issues with
hackers and I’m looking at alternatives for another
platform. I would be awesome if you could point me in the direction of a good platform.
my web blog :: discuss
Wonderful info, Appreciate it.
Check out my web site :: https://help-sp.ru/index.php?action=profile;area=forumprofile
You definitely made the point.
Have a look at my page; http://destyy.com/ehxaG0
Hi there! I’m at work browsing your blog from my
new iphone 3gs! Just wanted to say I love reading
your blog and look forward to all your posts! Keep up the superb work!
my homepage — online casino michigan sign up bonus
I’ve been exploring for a bit for any high-quality articles or weblog posts on this sort of area .
Exploring in Yahoo I eventually stumbled upon this web site.
Reading this information So i’m happy to show that I’ve an incredibly good
uncanny feeling I found out exactly what I needed.
I so much for sure will make certain to don?t disregard this site
and provides it a glance on a continuing basis.
Here is my homepage online casino in new york
Way cool! Some very valid points! I appreciate you writing this post plus the rest of the site is extremely good.
Review my web-site — wow vegas online casino
Hi! Do you know if they make any plugins to protect against hackers?
I’m kinda paranoid about losing everything I’ve worked hard on. Any tips?
Here is my blog; 1ufabet เครดิตฟรี
Have you ever considered about including a
little bit more than just your articles? I mean, what
you say is valuable and all. Nevertheless think about if
you added some great images or video clips to give your posts more,
«pop»! Your content is excellent but with pics
and clips, this site could certainly be one of the most beneficial
in its niche. Good blog!
My web page — galaxy club เครดิตฟรี 188 บาท
I think that what you published made a great deal of sense.
But, what about this? what if you composed a catchier title?
I ain’t saying your information isn’t solid, but what if you added a post title
to maybe grab a person’s attention? I mean Установка apache,
mysql, php, ftp на Debian GNU/Linux — Поснов Андрей is a little vanilla.
You should peek at Yahoo’s home page and see how they create news
headlines to get viewers to open the links. You might add
a related video or a pic or two to grab people excited about everything’ve got to say.
Just my opinion, it would make your posts a little livelier.
Feel free to surf to my web site; เครดิตฟรี 50 ไม่ต้องทํากิจกรรม
Good info Cheers.
My site: http://skdlabs.com/bbs/home.php?mod=space&uid=1806155
Hello there, You’ve done an incredible job. I’ll definitely digg it and personally recommend to my friends.
I’m sure they will be benefited from this website.
Take a look at my page: sfc588 เครดิตฟรี
Nicely put, Cheers.
Also visit my page https://informatic.wiki/wiki/How_to_Stay_Safe_and_Secure_When_Gambling_Online_within_the_Philippines
Thanks for one’s marvelous posting! I certainly enjoyed reading it, you might be a great
author. I will be sure to bookmark your blog and will eventually come back sometime soon. I want to encourage you to continue your great writing,
have a nice morning!
my web page: online casino 20 minimum deposit
great put up, very informative. I wonder
why the opposite specialists of this sector do not notice this.
You must continue your writing. I’m confident, you’ve a great readers’ base already!
my site; b2yz เครดิตฟรี
Helpful facts Kudos.
my blog post: http://bbs.szwifisky.com/home.php?mod=space&uid=2310937
A fascinating discussion is worth comment. I think that you
should write more about this subject matter, it
may not be a taboo matter but generally folks don’t talk about such subjects.
To the next! Many thanks!!
My web blog :: online casino australia no deposit bonus
I’m curious to find out what blog system you happen to
be using? I’m having some small security issues with my latest website and I’d like to find something
more risk-free. Do you have any suggestions?
my site; discuss
When I initially commented I clicked the «Notify me when new comments are added»
checkbox and now each time a comment is added I
get three e-mails with the same comment.
Is there any way you can remove me from that service?
Bless you!
My homepage; ทวิต เครดิตฟรี 2022
It’s hard to come by educated people for this topic, but you
seem like you know what you’re talking about!
Thanks
Here is my homepage; arizona online casino
We are a gaggle of volunteers and opening a new scheme in our
community. Your site provided us with valuable information to work on. You have performed a formidable
job and our whole community might be grateful to you.
Also visit my web-site … m98 เครดิตฟรี 68
Heya i’m for the first time here. I came across this board and
I find It truly useful & it helped me out much. I hope to give something back
and help others like you aided me.
Feel free to surf to my blog: online casino background
Hello there! This blog post could not be written any better!
Reading through this article reminds me of my previous roommate!
He continually kept talking about this. I most certainly will forward this article
to him. Fairly certain he’ll have a very good read.
Thanks for sharing!
my web-site … เครดิตฟรี กด รับ เอง 188
It’s actually a nice and useful piece of info. I’m satisfied that you just shared
this useful information with us. Please keep us informed like this.
Thank you for sharing.
my blog; มาเฟีย 123 แจก เครดิตฟรี 50
This is very interesting, You’re a very skilled blogger.
I’ve joined your rss feed and look forward to seeking
more of your excellent post. Also, I have shared your site in my social
networks!
My page; fun88 ทางเข้า