Linux中國

在 Ubuntu 15.04 / CentOS 7 上安裝廣告伺服器 Revive Adserver

1. 安裝LAMP

首先,Revive Adserver需要完整的LAMP環境才能運行,所以我們先安裝LAMP。LAMP是Apache網頁伺服器,MySQL/MariaDB資料庫和PHP模塊的集合。要使Revive正常運行,需要安裝PHP的眾多模塊,如apc, zlib, xml, pcre, mysql和mbstring。在不同的Linux發行版中,我們可以用下列命令進行LAMP的配置:

在Ubuntu 15.04下

# apt-get install apache2 mariadb-server php5 php5-gd php5-mysql php5-curl php-apc zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev libapache2-mod-php5 zip

在CentOS 7下

# yum install httpd mariadb php php-gd php-mysql php-curl php-mbstring php-xml php-apc zlibc zlib1g zlib1g-dev libpcre3 libpcre3-dev zip

2. 啟動Apache Web和MariaDB服務

可以用下列命令啟動剛剛安裝好的Apache Web服務和MariaDB資料庫服務。

在Ubuntu 15.04下

Ubuntu15.04使用Systemd作為默認初始系統,所以用下列命令啟動Apache和MariaDB進程:

# systemctl start apache2 mysql

可以用下列命令使其開機自動運行:

# systemctl enable apache2 mysql

Synchronizing state for apache2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d apache2 defaults
Executing /usr/sbin/update-rc.d apache2 enable
Synchronizing state for mysql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d mysql defaults
Executing /usr/sbin/update-rc.d mysql enable

在CentOS 7下

CentOS 7同樣是以Systemd作為默認初始系統,可以用下列命令啟動:

# systemctl start httpd mariadb

ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/multi-user.target.wants/mariadb.service'

3. 配置MariaDB

在CentOS 7/Ubuntu 15.04下

當我們第一次啟動MariaDB時,MariaDB是沒有分配密碼的,所以要先設置一個root密碼。之後再創建一個新的資料庫用來儲存Revive Adserver的數據。

使用以下命令配置MariaDB並設置其root密碼:

# mysql_secure_installation

這時會要我們輸入root密碼,但我們之前什麼密碼都沒設置,所以按回車下一步。之後,要求設置root密碼,這時我們輸入Y,然後輸入自己想要的密碼。回車繼續下一步。

 …
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!
…
installation should now be secure.
Thanks for using MariaDB!

Configuring MariaDB

4. 創建新的資料庫

為MariaDB的root用戶設置了密碼之後,就可以創建用來儲存Revive Adserver應用數據的資料庫。首先通過以下命令登錄MariaDB控制台:

# mysql -u root -p

這時要求輸入root用戶的密碼,我們只要輸入上一步設置好的密碼。然後進入MariaDB控制台創建新的資料庫,資料庫用戶及其密碼,並且授予其創建、刪除、編輯和存儲表與數據的全部許可權。

> CREATE DATABASE revivedb;
> CREATE USER 'reviveuser'@'localhost' IDENTIFIED BY 'Pa$$worD123';
> GRANT ALL PRIVILEGES ON revivedb.* TO 'reviveuser'@'localhost';
> FLUSH PRIVILEGES;
> EXIT;

Creating Mariadb Revive Database

5. 下載Revive Adserver

接下來下載Revive Adserver的最新版本Revive Adserver.3.2.2(寫本文時)。可以使用wget命令從Revive Adserverde 官方網站下載壓縮包,網址是:http://www.revive-adserver.com/download/ 。命令如下:

# cd /tmp/
# wget http://download.revive-adserver.com/revive-adserver-3.2.2.zip

--2015-11-09 17:03:48-- http://download.revive-adserver.com/revive-adserver-3.2.2.zip
Resolving download.revive-adserver.com (download.revive-adserver.com)... 54.230.119.219, 54.239.132.177, 54.230.116.214, ...
Connecting to download.revive-adserver.com (download.revive-adserver.com)|54.230.119.219|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11663620 (11M) [application/zip]
Saving to: 'revive-adserver-3.2.2.zip'
revive-adserver-3.2 100%[=====================>] 11.12M 1.80MB/s in 13s
2015-11-09 17:04:02 (906 KB/s) - 'revive-adserver-3.2.2.zip' saved [11663620/11663620]

解壓到臨時目錄下:

# unzip revive-adserver-3.2.2.zip

把解壓後的整個文件夾移動到Apache Web伺服器的默認根目錄/var/www/html/下:

# mv revive-adserver-3.2.2 /var/www/html/reviveads

6. 配置Apache Web服務

現在配置Apache服務使Revive正常運行。通過創建配置文件reviveads.conf來創建一個新的虛擬主機。這個目錄在不同的Linux發行版上有所不同。

在Ubuntu 15.04下

# touch /etc/apache2/sites-available/reviveads.conf
# ln -s /etc/apache2/sites-available/reviveads.conf /etc/apache2/sites-enabled/reviveads.conf
# nano /etc/apache2/sites-available/reviveads.conf

在這個文件中添加下列幾行文本:

<VirtualHost *:80>
ServerAdmin info@reviveads.linoxide.com
DocumentRoot /var/www/html/reviveads/
ServerName reviveads.linoxide.com
ServerAlias www.reviveads.linoxide.com
<Directory /var/www/html/reviveads/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/apache2/reviveads.linoxide.com-error_log
CustomLog /var/log/apache2/reviveads.linoxide.com-access_log common
</VirtualHost>

Configuring Apache2 Ubuntu

保存並退出,重啟Apache Web服務:

# systemctl restart apache2

在CentOS 7下

在CentOS下,我們直接在/etc/httpd/conf.d/ 目錄下創建reviveads.conf :

# nano /etc/httpd/conf.d/reviveads.conf 

在這個文件中添加下列幾行文本:

<VirtualHost *:80>
ServerAdmin info@reviveads.linoxide.com
DocumentRoot /var/www/html/reviveads/
ServerName reviveads.linoxide.com
ServerAlias www.reviveads.linoxide.com
<Directory /var/www/html/reviveads/>
Options FollowSymLinks
AllowOverride All
</Directory>
ErrorLog /var/log/httpd/reviveads.linoxide.com-error_log
CustomLog /var/log/httpd/reviveads.linoxide.com-access_log common
</VirtualHost>

Configuring httpd Centos

保存並退出,重啟Apache Web服務:

# systemctl restart httpd

7. 修復許可權和所有權

現在我們修改安裝路徑下文件的許可權和所有權。把安裝目錄的所有權改成Apache進程所有,以便Apache Web服務有文件和目錄的編輯、創建和刪除的完全許可權。

在Ubuntu 15.04下

# chown www-data: -R /var/www/html/reviveads

在CentOS 7下

# chown apache: -R /var/www/html/reviveads  

8. 設置防火牆

現在要配置防火牆,打開80埠使Apache Web服務運行的Revive Adserver能夠被網路上的其他機器所訪問。

在Ubuntu 15.04/CentOS 7下

Ubuntu15.04/CentOS 7都使用Systemd作為默認初始系統,使用firewalld作為其防火牆。要打開80埠(http服務埠),執行以下命令:

# firewall-cmd --permanent --add-service=http

success

# firewall-cmd --reload

success 

9. 網站的安裝

順利的話我們能夠使用瀏覽器進行交互,並可以將瀏覽器指向正在運行的網路伺服器。只要在瀏覽器輸入http://ip-address/ 或者 http://domain.com 。這裡我們要訪問 http://reviveads.linoxide.com/

打開後可以看到Revive Adserver的歡迎頁面,上面還有作為它發行許可證的GNU通用公共許可證V2。點擊 I agree 繼續下一步安裝。

在下一頁中,我們要輸入資料庫信息以便把Revive Adserver和MariaDB資料庫服務連接起來。要輸入之前設置的資料庫名稱,用戶名以及密碼。在本教程中,我們分別輸入資料庫名稱為revivedb,用戶名為reviveuser,密碼為Pa$$worD123,並且令主機名為localhost,點擊continue繼續。

Configuring Revive Adserver

輸入要填的信息,如:管理員用戶名,密碼和郵箱。可以以這些信息登錄Adserver的控制界面。然後跳到最後一頁,可以看到Revive Adserver已經安裝成功了。

接著,轉到Adverstiser頁面,添加新的廣告管理。在控制界面添加新用戶到adserver,為廣告庫戶添加標題,網頁,視頻 廣告

總結

本文中,我們學習了如何在Ubuntu 15.04和CentOS 7上安裝並配置Revive Adserver。儘管Revive Adserver的原始代碼是從OpenX那買的,但現在OpenX Enterprise和Revive Adserver已經完全分開了。可以從http://www.adserverplugins.com/ 獲得更多插件來擴展新特性。講真,這個軟體確實讓網頁,應用,視頻上的廣告管理變得容易了許多。

via: http://linoxide.com/linux-how-to/install-revive-adserver-ubuntu-15-04-centos-7/

作者:Arun Pyasi 譯者:chisper 校對:wxy

本文由 LCTT 原創編譯,Linux中國 榮譽推出


本文轉載來自 Linux 中國: https://github.com/Linux-CN/archive

對這篇文章感覺如何?

太棒了
0
不錯
0
愛死了
0
不太好
0
感覺很糟
0
雨落清風。心向陽

    You may also like

    35 Comments

    1. Thank you for the good writeup. It in fact was a amusement account it.
      Look advanced to more added agreeable from
      you! However, how can we communicate?

    2. You’re so interesting! I do not suppose I have read something like that before.

      So great to find another person with some original thoughts on this
      topic. Seriously.. many thanks for starting this up.
      This web site is something that is needed on the internet, someone with a bit of originality!

    3. With havin so much content and articles do you
      ever run into any problems of plagorism or copyright infringement?
      My blog has a lot of exclusive content I’ve either written myself or outsourced but it appears a lot of it
      is popping it up all over the internet without my permission. Do you know any techniques to help protect against content from being stolen? I’d
      genuinely appreciate it.

    4. https://animated-khapse-c18259.netlify.app/

      I like the helpful information you provide in your articles.

      I will bookmark your weblog and check again here frequently.
      I am quite sure I’ll learn many new stuff right here!
      Best of luck for the next!

    5. Fastidious answers in return of this issue with real arguments
      and explaining everything about that.

    6. It’s difficult to find educated people about this subject, but
      you seem like you know what you’re talking about! Thanks

    7. Wow, marvelous blog format! How long have you been running a blog for?

      you made blogging glance easy. The overall glance
      of your website is wonderful, as smartly as the content!

    8. Its like you read my mind! You appear to know so much about this,
      like you wrote the book in it or something.

      I think that you can do with a few pics to drive the message home a
      little bit, but instead of that, this is excellent blog. A
      great read. I will certainly be back.

    9. Thank you, I have recently been searching for info approximately this topic for ages and yours is the greatest I have discovered till now.

      However, what in regards to the conclusion? Are you
      sure concerning the source?

    10. Useful information. Fortunate me I discovered your site accidentally, and
      I’m shocked why this twist of fate didn’t happened earlier!
      I bookmarked it.

    11. Whats up are using WordPress for your blog platform? I’m new to the blog world but I’m trying
      to get started and set up my own. Do you require any coding expertise to make your own blog?
      Any help would be greatly appreciated!

    12. It’s a pity you don’t have a donate button! I’d definitely donate to this excellent blog!
      I guess for now i’ll settle for bookmarking and
      adding your RSS feed to my Google account. I look
      forward to fresh updates and will talk about this blog with my Facebook
      group. Chat soon!

    13. When I originally commented I appear to have clicked the -Notify me when new comments are added- checkbox
      and now each time a comment is added I receive four emails
      with the same comment. There has to be a way you are
      able to remove me from that service? Many thanks!

    14. Hey excellent website! Does running a blog like this take a great
      deal of work? I have no expertise in programming but I had been hoping to start my own blog soon. Anyhow, should you have any
      suggestions or tips for new blog owners please share.
      I know this is off topic nevertheless I just wanted to ask.

      Thank you!

    15. It’s very straightforward to find out any matter on net as compared to books, as I found this piece of writing at this website.

    16. What’s up to all, how is the whole thing, I think every one
      is getting more from this website, and your views are good in favor of new users.

    17. The other day, while I was at work, my cousin stole my iphone
      and tested to see if it can survive a 40 foot drop, just
      so she can be a youtube sensation. My iPad is now broken and she has 83 views.
      I know this is completely off topic but I had to share it with someone!

    18. Hi there! Do you know if they make any plugins to assist with Search Engine Optimization? I’m trying
      to get my blog to rank for some targeted keywords but I’m not seeing very good results.
      If you know of any please share. Appreciate it!

    19. Hey there outstanding blog! Does running a blog similar to this require
      a massive amount work? I have no knowledge of computer programming however
      I had been hoping to start my own blog in the near future.
      Anyways, if you have any ideas or tips for new blog
      owners please share. I understand this is off subject but I
      simply had to ask. Thanks!

    20. Hello there I am so thrilled I found your blog, I really
      found you by error, while I was browsing on Askjeeve for something else, Regardless
      I am here now and would just like to say thanks a
      lot for a incredible post and a all round thrilling blog (I also love the theme/design), I don』t have time to look over
      it all at the moment but I have bookmarked it and also included your RSS feeds, so when I
      have time I will be back to read more, Please do keep up the superb jo.

    21. you’re actually a excellent webmaster. The website loading pace is amazing.
      It kind of feels that you’re doing any distinctive trick.

      Also, The contents are masterpiece. you’ve done a magnificent
      job on this matter!

    22. Howdy! This blog post couldn’t be written any better!
      Going through this post reminds me of my previous roommate!
      He always kept talking about this. I’ll forward this information to
      him. Fairly certain he’s going to have a good read. Thanks for sharing!

    23. Excellent website. Plenty of helpful information here. I am
      sending it to some pals ans also sharing in delicious.
      And naturally, thank you in your sweat!

    24. This is a great place to change money with very good rates .

    25. Incredible! This blog looks exactly like my old one!

      It’s on a entirely different topic but it has pretty much the
      same page layout and design. Great choice of colors!

    26. These are in fact impressive ideas in regarding blogging.

      You have touched some pleasant factors here. Any way keep
      up wrinting.

    27. My partner and I stumbled over here by a different
      web address and thought I should check things out. I like what I see so now i am following you.

      Look forward to looking over your web page
      yet again.

    28. You are so interesting! I do not think I’ve read anything like this before.
      So wonderful to discover somebody with a few original thoughts on this
      subject matter. Seriously.. thanks for starting this up.
      This web site is something that is needed on the internet,
      someone with a little originality!

    29. This web site definitely has all the information and facts
      I wanted about this subject and didn’t know who
      to ask.

    30. Hi, just wanted to say, I enjoyed this article. It was funny.
      Keep on posting!

    31. Greetings from Carolina! I’m bored to tears at work so I decided to browse your site on my iphone during lunch break.
      I enjoy the information you provide here and can’t wait to take
      a look when I get home. I’m shocked at how quick your blog loaded on my phone ..
      I’m not even using WIFI, just 3G .. Anyways, wonderful blog!

    32. I got this web page from my buddy who told me regarding this website and now
      this time I am browsing this site and reading very informative content at this time.

    33. Fastidious response in return of this matter with genuine
      arguments and describing everything about that.

    34. Spot on with this write-up, I truly feel this site needs a lot more attention.
      I’ll probably be back again to read through more, thanks
      for the info!

    35. Pretty great post. I simply stumbled upon your weblog and
      wanted to mention that I’ve really enjoyed surfing around your
      weblog posts. In any case I will be subscribing to your
      rss feed and I’m hoping you write once more very soon!

    Leave a reply

    您的郵箱地址不會被公開。 必填項已用 * 標註

    這個站點使用 Akismet 來減少垃圾評論。了解你的評論數據如何被處理

    More in:Linux中國