0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS 7にdjango-powerdnsをインストール

Last updated at Posted at 2014-11-24

あまり良くわかっていない。

参考

インストール

mysql側準備
mysql -u root -e "CREATE DATABASE powerdns CHARACTER SET utf8;"
mysql -u root -e "CREATE USER 'powerdns'@'localhost' IDENTIFIED BY 'powerdns';"
mysql -u root -e "GRANT ALL PRIVILEGES ON powerdns.* TO 'powerdns'@'localhost';"
yum install -y MySQL-python
easy_install django-powerdns
cd /srv
django-admin.py startproject mypowerdns
/srv/mypowerdns/mypowerdns/settings.py
INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
+   'powerdns',
)

DATABASES = {
    'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
+        'ENGINE': 'django.db.backends.mysql',
+        'NAME': 'powerdns',
+        'USER': 'powerdns',
+        'PASSWORD': 'powerdns',
+        'HOST': '',
+        'PORT': '',
    }
}
-LANGUAGE_CODE = 'en-us'
+LANGUAGE_CODE = 'ja'
-TIME_ZONE = 'UTC'
+TIME_ZONE = 'Asia/Tokyo'
/srv/mypowerdns/mypowerdns/urls.py
 from django.conf.urls import patterns, include, url
 from django.contrib import admin
+admin.autodiscover()
 
 urlpatterns = patterns('',
     # Examples:
     # url(r'^$', 'mypowerdns.views.home', name='home'),
     # url(r'^blog/', include('blog.urls')),
 
     url(r'^admin/', include(admin.site.urls)),
 )
# cd /srv/mypowerdns/
# python manage.py syncdb
Operations to perform:
  Synchronize unmigrated apps: powerdns
  Apply all migrations: admin, contenttypes, auth, sessions
Synchronizing apps without migrations:
  Creating tables...
    Creating table domains
    Creating table records
    Creating table supermasters
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying contenttypes.0001_initial... OK
  Applying auth.0001_initial... OK
  Applying admin.0001_initial... OK
  Applying sessions.0001_initial... OK

You have installed Django's auth system, and don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'):
Email address:
Password:
Password (again):
Superuser created successfully.
django-powerdns起動
python manage.py runserver

powerdns側設定

/etc/pdns/pdns.conf
launch=gmysql
gmysql-socket=/var/lib/mysql/mysql.sock
gmysql-user=powerdns
gmysql-password=powerdns
gmysql-dbname=powerdns
systemctl pdns restart
journalctl -u pdns -f -l
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?